Skip to content

Commit

Permalink
convert_path no longer fails if passed a path with a trailing slash. …
Browse files Browse the repository at this point in the history
…Instead, trailing slashes are stripped just as they are with pathlib.Path.

Ref #272 (comment).
  • Loading branch information
jaraco committed Aug 2, 2024
1 parent 90cbfbe commit e2cbf97
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions distutils/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ def test_convert_path(self):

with pytest.raises(ValueError):
convert_path('/home/to/my/stuff')
with pytest.raises(ValueError):
convert_path('home/to/my/stuff/')
with pytest.raises(ValueError):
convert_path(pathlib.Path('/home/to/my/stuff'))

Expand Down
2 changes: 0 additions & 2 deletions distutils/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ def make_native(pathname: str) -> str:
return pathname
if pathname[0] == '/':
raise ValueError(f"path '{pathname}' cannot be absolute")
if pathname[-1] == '/':
raise ValueError(f"path '{pathname}' cannot end with '/'")

paths = pathname.split('/')
while '.' in paths:
Expand Down

0 comments on commit e2cbf97

Please sign in to comment.