mirror of
https://github.com/python/cpython.git
synced 2024-11-24 18:34:43 +08:00
Issue #15845: Fix comparison between bytes and string.
Patch by Alessandro Moura.
This commit is contained in:
commit
1a03ac832d
@ -236,7 +236,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)
|
||||
|
Loading…
Reference in New Issue
Block a user