Skip to content

Commit

Permalink
Use Python 3 super() syntax. (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
atombrella authored and mayeut committed Oct 19, 2019
1 parent 7196286 commit 8fc14ac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions auditwheel/condatools.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ class InCondaPkg(InTemporaryDirectory):
def __init__(self, in_conda_pkg):
"""Initialize in-conda-package context manager"""
self.in_conda_pkg = os.path.abspath(in_conda_pkg)
super(InCondaPkg, self).__init__()
super().__init__()

def __enter__(self):
tarbz2todir(self.in_conda_pkg, self.name)
return super(InCondaPkg, self).__enter__()
return super().__enter__()


class InCondaPkgCtx(InCondaPkg):
def __init__(self, in_conda_pkg):
super(InCondaPkgCtx, self).__init__(in_conda_pkg)
super().__init__(in_conda_pkg)
self.path = None

def __enter__(self):
self.path = super(InCondaPkgCtx, self).__enter__()
self.path = super().__enter__()
return self

def iter_files(self):
Expand Down
2 changes: 1 addition & 1 deletion auditwheel/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def __init__(self, env, required=True, default=None, **kwargs):
'%(env)r (choose from %(choices)s)'
raise argparse.ArgumentError(self, msg % args)

super(EnvironmentDefault, self).__init__(
super().__init__(
default=default,
required=required,
**kwargs
Expand Down
10 changes: 5 additions & 5 deletions auditwheel/wheeltools.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ def __init__(self, in_wheel, out_wheel=None, ret_self=False):
"""
self.in_wheel = abspath(in_wheel)
self.out_wheel = None if out_wheel is None else abspath(out_wheel)
super(InWheel, self).__init__()
super().__init__()

def __enter__(self):
zip2dir(self.in_wheel, self.name)
return super(InWheel, self).__enter__()
return super().__enter__()

def __exit__(self, exc, value, tb):
if self.out_wheel is not None:
rewrite_record(self.name)
dir2zip(self.name, self.out_wheel)
return super(InWheel, self).__exit__(exc, value, tb)
return super().__exit__(exc, value, tb)


class InWheelCtx(InWheel):
Expand Down Expand Up @@ -152,11 +152,11 @@ def __init__(self, in_wheel, out_wheel=None):
filename of wheel to write after exiting. If None, don't write and
discard
"""
super(InWheelCtx, self).__init__(in_wheel, out_wheel)
super().__init__(in_wheel, out_wheel)
self.path = None

def __enter__(self):
self.path = super(InWheelCtx, self).__enter__()
self.path = super().__enter__()
return self

def iter_files(self):
Expand Down

0 comments on commit 8fc14ac

Please sign in to comment.