Skip to content

Commit

Permalink
Simplify _make_child_relpath() further
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Jul 13, 2023
1 parent bbfd404 commit da9948d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,14 +940,11 @@ def _scandir(self):
return os.scandir(self)

def _make_child_relpath(self, name):
path_str = self._str
tail = self._tail
if tail:
path_str = f'{path_str}{self._flavour.sep}{name}'
elif path_str:
path_str = f'{path_str}{name}'
path_str = f'{self._str}{self._flavour.sep}{name}'
else:
path_str = name
path_str = f'{self._str}{name}'
path = self.with_segments(path_str)
path._str_cached = path_str
path._drv = self.drive
Expand Down

0 comments on commit da9948d

Please sign in to comment.