Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use super() #3054

Merged
merged 2 commits into from Jan 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/3054.misc.rst
@@ -0,0 +1 @@
Used Py3 syntax ``super().__init__()`` -- by :user:`imba-tjd`
4 changes: 2 additions & 2 deletions pkg_resources/__init__.py
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
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
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
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
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