mirror of
https://github.com/python/cpython.git
synced 2025-12-07 09:47:28 +00:00
Issue #15845: Fix comparison between bytes and string.
This commit is contained in:
commit
f6fb3a3206
1 changed files with 4 additions and 1 deletions
|
|
@ -260,7 +260,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…
Add table
Add a link
Reference in a new issue