summaryrefslogtreecommitdiff
path: root/Lib/macpath.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/macpath.py')
-rw-r--r--Lib/macpath.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/macpath.py b/Lib/macpath.py
index 3b3e4ff071..4ab7c09793 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()