Skip to content

Commit

Permalink
Restore Python 2.7 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jan 25, 2020
1 parent e59d21b commit d2dd174
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions test_zipp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import io
import zipfile
import posixpath
import contextlib
import tempfile
import shutil
Expand Down Expand Up @@ -207,8 +206,8 @@ def test_mutability(self):
for alpharep in self.zipfile_alpharep():
root = zipp.Path(alpharep)
a, b, g = root.iterdir()
alpharep.writestr('foo.txt', 'foo')
alpharep.writestr('bar/baz.txt', 'baz')
alpharep.writestr('foo.txt', b'foo')
alpharep.writestr('bar/baz.txt', b'baz')
assert any(
child.name == 'foo.txt'
for child in root.iterdir())
Expand Down
6 changes: 3 additions & 3 deletions zipp.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _implied_dirs(names):
return implied_dirs

def namelist(self):
names = super().namelist()
names = super(CompleteDirs, self).namelist()
return names + list(self._implied_dirs(names))

def _name_set(self):
Expand Down Expand Up @@ -122,13 +122,13 @@ class FastLookup(CompleteDirs):
def namelist(self):
with suppress(AttributeError):
return self.__names
self.__names = super().namelist()
self.__names = super(FastLookup, self).namelist()
return self.__names

def _name_set(self):
with suppress(AttributeError):
return self.__lookup
self.__lookup = super()._name_set()
self.__lookup = super(FastLookup, self)._name_set()
return self.__lookup


Expand Down

0 comments on commit d2dd174

Please sign in to comment.