summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-08 09:32:58 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-08 09:32:58 (GMT)
commit4ab23bfbeb94f1ade79def3d096ed2daaea6bc79 (patch)
tree6b63bfb5d10d7d42601a46da7fe5c051085f980f /Lib/os.py
parente50f4d2220c22cc84208ba3f1702ffa4e9df6196 (diff)
downloadcpython-4ab23bfbeb94f1ade79def3d096ed2daaea6bc79.zip
cpython-4ab23bfbeb94f1ade79def3d096ed2daaea6bc79.tar.gz
cpython-4ab23bfbeb94f1ade79def3d096ed2daaea6bc79.tar.bz2
Issue #15845: Fix comparison between bytes and string.
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/os.py b/Lib/os.py
index d1101a2..81e037a 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -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)