summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author谭九鼎 <109224573@qq.com>2022-01-26 16:58:29 +0800
committer谭九鼎 <109224573@qq.com>2022-01-26 16:58:29 +0800
commita7c6d64f76091d1cfd8297ba813fe4e901d00ce4 (patch)
tree71bd1a41b85ce19a9ed7554825a576b4fb6de6d1
parent1a1397a4ef0327ba09ddd4a3d0916af48d3be7ec (diff)
downloadpython-setuptools-git-a7c6d64f76091d1cfd8297ba813fe4e901d00ce4.tar.gz
Use super()
-rw-r--r--pkg_resources/__init__.py4
-rw-r--r--setuptools/__init__.py4
-rw-r--r--setuptools/command/easy_install.py2
-rw-r--r--setuptools/extension.py2
-rw-r--r--setuptools/package_index.py4
5 files changed, 8 insertions, 8 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 9cc6b0a4..9933aad8 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 43d1c96e..06991b65 100644
--- a/setuptools/__init__.py
+++ b/setuptools/__init__.py
@@ -132,7 +132,7 @@ def _install_setup_requires(attrs):
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 @@ class Command(_Command):
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 514719de..5fab0fdb 100644
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1577,7 +1577,7 @@ class PthDistributions(Environment):
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 1820722a..f696c9c1 100644
--- a/setuptools/extension.py
+++ b/setuptools/extension.py
@@ -34,7 +34,7 @@ class Extension(_Extension):
# 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 270e7f3c..051e523a 100644
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -285,7 +285,7 @@ class PackageIndex(Environment):
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 @@ class PyPIConfig(configparser.RawConfigParser):
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):