diff options
author | Tomás Farías <tomasfariassantana@gmail.com> | 2019-11-19 05:54:00 (GMT) |
---|---|---|
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2019-11-19 05:54:00 (GMT) |
commit | fe75b62575bcfdf1c39be71c1e50257832a596db (patch) | |
tree | a1792cba0d7c91536e2e3d2cb96a235e225f2f25 /Lib/genericpath.py | |
parent | 02b8051a5e21f3db6af80dc5526156d7cac2afa0 (diff) | |
download | cpython-fe75b62575bcfdf1c39be71c1e50257832a596db.zip cpython-fe75b62575bcfdf1c39be71c1e50257832a596db.tar.gz cpython-fe75b62575bcfdf1c39be71c1e50257832a596db.tar.bz2 |
bpo-38807: Add os.PathLike to exception message raised by _check_arg_types (#17160)
Diffstat (limited to 'Lib/genericpath.py')
-rw-r--r-- | Lib/genericpath.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/genericpath.py b/Lib/genericpath.py index db11f67..ce36451 100644 --- a/Lib/genericpath.py +++ b/Lib/genericpath.py @@ -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 |