Issue #15845: Fix comparison between bytes and string.
This commit is contained in:
parent
e50f4d2220
commit
4ab23bfbeb
|
@ -146,7 +146,10 @@ def makedirs(name, mode=0o777, exist_ok=False):
|
||||||
# be happy if someone already created the path
|
# be happy if someone already created the path
|
||||||
if e.errno != errno.EEXIST:
|
if e.errno != errno.EEXIST:
|
||||||
raise
|
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
|
return
|
||||||
try:
|
try:
|
||||||
mkdir(name, mode)
|
mkdir(name, mode)
|
||||||
|
|
Loading…
Reference in New Issue