mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Issue #15845: Fix comparison between bytes and string.
This commit is contained in:
parent
e50f4d2220
commit
4ab23bfbeb
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue