mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
#9018: os.path.normcase() now raises a TypeError if the argument is not str or bytes.
This commit is contained in:
parent
6186bfb735
commit
5a3ef5b22a
7 changed files with 27 additions and 7 deletions
|
@ -49,6 +49,9 @@ def _get_sep(path):
|
|||
def normcase(s):
|
||||
"""Normalize case of pathname. Has no effect under Posix"""
|
||||
# TODO: on Mac OS X, this should really return s.lower().
|
||||
if not isinstance(s, (bytes, str)):
|
||||
raise TypeError("normcase() argument must be str or bytes, "
|
||||
"not '{}'".format(s.__class__.__name__))
|
||||
return s
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue