summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-08 09:36:54 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-08 09:36:54 (GMT)
commitf6fb3a3206dcd27a68f5717c08d83ee8f1466545 (patch)
treefdc7b8bbfbfd1cb017f04a191eff13c646bd3cba /Lib/os.py
parenta2ad5c3ad1bbf6d2088ff3ab2eb3bba51d096cc2 (diff)
parent4ab23bfbeb94f1ade79def3d096ed2daaea6bc79 (diff)
downloadcpython-f6fb3a3206dcd27a68f5717c08d83ee8f1466545.zip
cpython-f6fb3a3206dcd27a68f5717c08d83ee8f1466545.tar.gz
cpython-f6fb3a3206dcd27a68f5717c08d83ee8f1466545.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 84eeaeb..e4ea142 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -260,7 +260,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)