Skip to content

Commit

Permalink
Removed _pathlib_compat, no longer needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Apr 3, 2022
1 parent c080227 commit 5f5c154
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions zipp.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def make(cls, source):
return source

if not isinstance(source, zipfile.ZipFile):
return cls(_pathlib_compat(source))
return cls(source)

# Only allow for FastLookup when supplied zipfile is read-only
if 'r' not in source.mode:
Expand Down Expand Up @@ -130,17 +130,6 @@ def _name_set(self):
return self.__lookup


def _pathlib_compat(path):
"""
For path-like objects, convert to a filename for compatibility
on Python 3.6.1 and earlier.
"""
try:
return path.__fspath__()
except AttributeError:
return str(path)


class Path:
"""
A pathlib-compatible interface for zip files.
Expand Down Expand Up @@ -308,7 +297,7 @@ def __repr__(self):
return self.__repr.format(self=self)

def joinpath(self, *other):
next = posixpath.join(self.at, *map(_pathlib_compat, other))
next = posixpath.join(self.at, *other)
return self._next(self.root.resolve_dir(next))

__truediv__ = joinpath
Expand Down

0 comments on commit 5f5c154

Please sign in to comment.