mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
bpo-38807: Add os.PathLike to exception message raised by _check_arg_types (#17160)
This commit is contained in:
parent
02b8051a5e
commit
fe75b62575
2 changed files with 3 additions and 2 deletions
|
@ -149,7 +149,7 @@ def _check_arg_types(funcname, *args):
|
|||
elif isinstance(s, bytes):
|
||||
hasbytes = True
|
||||
else:
|
||||
raise TypeError('%s() argument must be str or bytes, not %r' %
|
||||
(funcname, s.__class__.__name__)) from None
|
||||
raise TypeError(f'{funcname}() argument must be str, bytes, or '
|
||||
f'os.PathLike object, not {s.__class__.__name__!r}') from None
|
||||
if hasstr and hasbytes:
|
||||
raise TypeError("Can't mix strings and bytes in path components") from None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue