diff --git a/changelog.d/3054.misc.rst b/changelog.d/3054.misc.rst new file mode 100644 index 0000000000..7166f83730 --- /dev/null +++ b/changelog.d/3054.misc.rst @@ -0,0 +1 @@ +Used Py3 syntax ``super().__init__()`` -- by :user:`imba-tjd` diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 9cc6b0a4d9..9933aad857 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -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): @@ -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): diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 43d1c96eb2..06991b65d7 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -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): """ @@ -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): diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 514719dedc..5fab0fdb5b 100644 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -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))) diff --git a/setuptools/extension.py b/setuptools/extension.py index 1820722a49..f696c9c1ac 100644 --- a/setuptools/extension.py +++ b/setuptools/extension.py @@ -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): """ diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 270e7f3c91..051e523a57 100644 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -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 = {} @@ -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):