summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-08 09:38:45 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-08 09:38:45 (GMT)
commit1a03ac832dae04a4a8044f59a894c579fec4e439 (patch)
tree62e655c1a3a7f5b95dec8ac57f678cfb52c5947e /Lib/os.py
parent15738427f612a447475254d0ac26ce4b4bb9ef2e (diff)
parentf6fb3a3206dcd27a68f5717c08d83ee8f1466545 (diff)
downloadcpython-1a03ac832dae04a4a8044f59a894c579fec4e439.zip
cpython-1a03ac832dae04a4a8044f59a894c579fec4e439.tar.gz
cpython-1a03ac832dae04a4a8044f59a894c579fec4e439.tar.bz2
Issue #15845: Fix comparison between bytes and string.
Patch by Alessandro Moura.
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 dbebf89..659f3cc 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -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)