Skip to content

Commit

Permalink
Undo pickling change
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Dec 17, 2023
1 parent 14a9635 commit 305381b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Lib/pathlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ def __init__(self, *args):
def __reduce__(self):
# Using the parts tuple helps share interned path parts
# when pickling related paths.
return (self.__class__, tuple(self._raw_paths))
args = tuple(self._tail)
if self.drive or self.root:
args = (self.drive + self.root,) + args
if self.has_trailing_sep:
args = args + ('.',)
return (self.__class__, args)

def __fspath__(self):
return str(self)
Expand Down

0 comments on commit 305381b

Please sign in to comment.