diff --git a/lib/zipp.py b/lib/zipp.py index 26b723c1..52c82a0e 100644 --- a/lib/zipp.py +++ b/lib/zipp.py @@ -3,14 +3,8 @@ import posixpath import zipfile import itertools import contextlib -import sys import pathlib -if sys.version_info < (3, 7): - from collections import OrderedDict -else: - OrderedDict = dict - __all__ = ['Path'] @@ -56,7 +50,7 @@ def _ancestry(path): path, tail = posixpath.split(path) -_dedupe = OrderedDict.fromkeys +_dedupe = dict.fromkeys """Deduplicate an iterable in original order""" @@ -107,7 +101,7 @@ class CompleteDirs(zipfile.ZipFile): 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: @@ -136,17 +130,6 @@ class FastLookup(CompleteDirs): 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. @@ -314,7 +297,7 @@ class Path: 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 diff --git a/requirements.txt b/requirements.txt index c4fe538f..0810ddc5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -48,7 +48,7 @@ urllib3==1.26.8 webencodings==0.5.1 websocket-client==1.2.3 xmltodict==0.12.0 -zipp==3.7.0 +zipp==3.8.0 # configobj==5.1.0 # sgmllib3k==1.0.0