summaryrefslogtreecommitdiff
path: root/Lib/os.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-08 11:32:58 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-08 11:32:58 +0200
commit5b32a821bf1e0ce81646f6d9d19aec4b8e744f64 (patch)
tree887d7a7c7d8e9608e33b2349a2cd69f266223690 /Lib/os.py
parente1d00f1d9aed88b910e2fef41d8a270821365e96 (diff)
downloadcpython-5b32a821bf1e0ce81646f6d9d19aec4b8e744f64.tar.gz
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 d1101a26a0..81e037af3c 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)