From 74510e2a57f6d4b51ac1ab4f778cd7a4c54b541e Mon Sep 17 00:00:00 2001 From: Wolfgang Maier Date: Thu, 28 Mar 2019 22:47:18 +0100 Subject: bpo-30427: eliminate redundant type checks in os.path.normcase() (GH-1712) https://bugs.python.org/issue30427 --- Lib/posixpath.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'Lib/posixpath.py') diff --git a/Lib/posixpath.py b/Lib/posixpath.py index 12ab2eadbf..21ce72fd79 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -51,11 +51,7 @@ def _get_sep(path): def normcase(s): """Normalize case of pathname. Has no effect under Posix""" - s = os.fspath(s) - if not isinstance(s, (bytes, str)): - raise TypeError("normcase() argument must be str or bytes, " - "not '{}'".format(s.__class__.__name__)) - return s + return os.fspath(s) # Return whether a path is absolute. -- cgit v1.2.1