Skip to content

Commit

Permalink
Merge pull request #3054 from imba-tjd/patch-2
Browse files Browse the repository at this point in the history
Use super()
  • Loading branch information
jaraco authored Jan 29, 2022
2 parents d3124ac + 4645c9b commit aa3d9b9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelog.d/3054.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Used Py3 syntax ``super().__init__()`` -- by :user:`imba-tjd`
4 changes: 2 additions & 2 deletions pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ class EggProvider(NullProvider):
"""Provider based on a virtual filesystem"""

def __init__(self, module):
NullProvider.__init__(self, module)
super().__init__(module)
self._setup_prefix()

def _setup_prefix(self):
Expand Down Expand Up @@ -1701,7 +1701,7 @@ class ZipProvider(EggProvider):
_zip_manifests = MemoizedZipManifests()

def __init__(self, module):
EggProvider.__init__(self, module)
super().__init__(module)
self.zip_pre = self.loader.archive + os.sep

def _zipinfo_name(self, fspath):
Expand Down
4 changes: 2 additions & 2 deletions setuptools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class MinimalDistribution(distutils.core.Distribution):
def __init__(self, attrs):
_incl = 'dependency_links', 'setup_requires'
filtered = {k: attrs[k] for k in set(_incl) & set(attrs)}
distutils.core.Distribution.__init__(self, filtered)
super().__init__(filtered)

def finalize_options(self):
"""
Expand Down Expand Up @@ -171,7 +171,7 @@ def __init__(self, dist, **kw):
Construct the command for dist, updating
vars(self) with any keyword parameters.
"""
_Command.__init__(self, dist)
super().__init__(dist)
vars(self).update(kw)

def _ensure_stringlike(self, option, what, default=None):
Expand Down
2 changes: 1 addition & 1 deletion setuptools/command/easy_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ def __init__(self, filename, sitedirs=()):
self.sitedirs = list(map(normalize_path, sitedirs))
self.basedir = normalize_path(os.path.dirname(self.filename))
self._load()
Environment.__init__(self, [], None, None)
super().__init__([], None, None)
for path in yield_lines(self.paths):
list(map(self.add, find_distributions(path, True)))

Expand Down
2 changes: 1 addition & 1 deletion setuptools/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, name, sources, *args, **kw):
# The *args is needed for compatibility as calls may use positional
# arguments. py_limited_api may be set only via keyword.
self.py_limited_api = kw.pop("py_limited_api", False)
_Extension.__init__(self, name, sources, *args, **kw)
super().__init__(name, sources, *args, **kw)

def _convert_pyx_sources_to_lang(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions setuptools/package_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def __init__(
self, index_url="https://pypi.org/simple/", hosts=('*',),
ca_bundle=None, verify_ssl=True, *args, **kw
):
Environment.__init__(self, *args, **kw)
super().__init__(*args, **kw)
self.index_url = index_url + "/" [:not index_url.endswith('/')]
self.scanned_urls = {}
self.fetched_urls = {}
Expand Down Expand Up @@ -1002,7 +1002,7 @@ def __init__(self):
Load from ~/.pypirc
"""
defaults = dict.fromkeys(['username', 'password', 'repository'], '')
configparser.RawConfigParser.__init__(self, defaults)
super().__init__(defaults)

rc = os.path.join(os.path.expanduser('~'), '.pypirc')
if os.path.exists(rc):
Expand Down

0 comments on commit aa3d9b9

Please sign in to comment.