diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-06-25 10:56:11 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-06-25 10:56:11 (GMT) |
commit | 5a3ef5b22af607666111c76764db0efffbef82be (patch) | |
tree | 68e3601264f88350017f6bd0a77c9b46b0237e52 /Lib/macpath.py | |
parent | 6186bfb735c90c22035d8b29a0e97ae39bd12d5b (diff) | |
download | cpython-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/macpath.py')
-rw-r--r-- | Lib/macpath.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/macpath.py b/Lib/macpath.py index 3b3e4ff..4ab7c09 100644 --- a/Lib/macpath.py +++ b/Lib/macpath.py @@ -32,6 +32,9 @@ def _get_colon(path): # Normalize the case of a pathname. Dummy in Posix, but <s>.lower() here. def normcase(path): + if not isinstance(path, (bytes, str)): + raise TypeError("normcase() argument must be str or bytes, " + "not '{}'".format(path.__class__.__name__)) return path.lower() |