mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
gh-117584: Raise TypeError for non-paths in posixpath.relpath() (GH-117585)
This commit is contained in:
parent
62aeb0ee69
commit
733e56ef96
3 changed files with 3 additions and 1 deletions
|
@ -502,10 +502,10 @@ supports_unicode_filenames = (sys.platform == 'darwin')
|
|||
def relpath(path, start=None):
|
||||
"""Return a relative version of a path"""
|
||||
|
||||
path = os.fspath(path)
|
||||
if not path:
|
||||
raise ValueError("no path specified")
|
||||
|
||||
path = os.fspath(path)
|
||||
if isinstance(path, bytes):
|
||||
curdir = b'.'
|
||||
sep = b'/'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue