Skip to content

Commit

Permalink
Prefer simpler path.rstrip to consolidate checks for empty or only pa…
Browse files Browse the repository at this point in the history
…ths.
  • Loading branch information
jaraco committed Aug 26, 2024
1 parent bec712f commit cc61e61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zipp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _ancestry(path):
['//b//d///f', '//b//d', '//b']
"""
path = path.rstrip(posixpath.sep)
while path and not path.endswith(posixpath.sep):
while path.rstrip(posixpath.sep):
yield path
path, tail = posixpath.split(path)

Expand Down

0 comments on commit cc61e61

Please sign in to comment.