Issue #15845: Fix comparison between bytes and string.

This commit is contained in:
Serhiy Storchaka 2013-01-08 11:32:58 +02:00
parent e50f4d2220
commit 4ab23bfbeb
1 changed files with 4 additions and 1 deletions

View File

@ -146,7 +146,10 @@ def makedirs(name, mode=0o777, exist_ok=False):
# be happy if someone already created the path
if e.errno != errno.EEXIST:
raise
if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists
cdir = curdir
if isinstance(tail, bytes):
cdir = bytes(curdir, 'ASCII')
if tail == cdir: # xxx/newdir/. exists if xxx/newdir exists
return
try:
mkdir(name, mode)