summaryrefslogtreecommitdiffstats
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-08-24 09:18:09 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-08-24 09:18:09 (GMT)
commit549c1972f2b063e3d36ffff6c917372db512e7d4 (patch)
treeeb1bef06735cd5ddc698bdf0f6a1af630a4ab1dd /Lib/posixpath.py
parentd00aff2f62481c3e8cf3b8e9cbbaf888361ffdd4 (diff)
downloadcpython-549c1972f2b063e3d36ffff6c917372db512e7d4.zip
cpython-549c1972f2b063e3d36ffff6c917372db512e7d4.tar.gz
cpython-549c1972f2b063e3d36ffff6c917372db512e7d4.tar.bz2
Issue #22034: Got rid of misleading error message for bytearray arguments in
posixpath.join().
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index eb17dba..0aa53fe 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -83,12 +83,10 @@ def join(a, *p):
else:
path += sep + b
except TypeError:
- valid_types = all(isinstance(s, (str, bytes, bytearray))
- for s in (a, ) + p)
- if valid_types:
+ if all(isinstance(s, (str, bytes)) for s in (a,) + p):
# Must have a mixture of text and binary data
raise TypeError("Can't mix strings and bytes in path "
- "components.") from None
+ "components") from None
raise
return path