From 5a3ef5b22af607666111c76764db0efffbef82be Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Fri, 25 Jun 2010 10:56:11 +0000 Subject: #9018: os.path.normcase() now raises a TypeError if the argument is not str or bytes. --- Lib/os2emxpath.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Lib/os2emxpath.py') diff --git a/Lib/os2emxpath.py b/Lib/os2emxpath.py index 184c9b169a..0ccbf8ae7b 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() -- cgit v1.2.1