summaryrefslogtreecommitdiffstats
path: root/Lib/os2emxpath.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-06-25 10:56:11 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-06-25 10:56:11 (GMT)
commit5a3ef5b22af607666111c76764db0efffbef82be (patch)
tree68e3601264f88350017f6bd0a77c9b46b0237e52 /Lib/os2emxpath.py
parent6186bfb735c90c22035d8b29a0e97ae39bd12d5b (diff)
downloadcpython-5a3ef5b22af607666111c76764db0efffbef82be.zip
cpython-5a3ef5b22af607666111c76764db0efffbef82be.tar.gz
cpython-5a3ef5b22af607666111c76764db0efffbef82be.tar.bz2
#9018: os.path.normcase() now raises a TypeError if the argument is not str or bytes.
Diffstat (limited to 'Lib/os2emxpath.py')
-rw-r--r--Lib/os2emxpath.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/os2emxpath.py b/Lib/os2emxpath.py
index 184c9b1..0ccbf8a 100644
--- a/Lib/os2emxpath.py
+++ b/Lib/os2emxpath.py
@@ -36,6 +36,9 @@ def normcase(s):
"""Normalize case of pathname.
Makes all characters lowercase and all altseps into seps."""
+ if not isinstance(s, (bytes, str)):
+ raise TypeError("normcase() argument must be str or bytes, "
+ "not '{}'".format(s.__class__.__name__))
return s.replace('\\', '/').lower()