Skip to content

Commit ef853fd

Browse files
authored
Merge pull request #4361
Use super in commands.install
2 parents 2212422 + 59c47e4 commit ef853fd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

newsfragments/4136.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
In install command, use super to call the superclass methods. Avoids race conditions when monkeypatching from _distutils_system_mod occurs late.

setuptools/command/install.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ def initialize_options(self):
4949
# and then add a due_date to this warning.
5050
)
5151

52-
orig.install.initialize_options(self)
52+
super().initialize_options()
5353
self.old_and_unmanageable = None
5454
self.single_version_externally_managed = None
5555

5656
def finalize_options(self):
57-
orig.install.finalize_options(self)
57+
super().finalize_options()
5858
if self.root:
5959
self.single_version_externally_managed = True
6060
elif self.single_version_externally_managed:
@@ -78,11 +78,11 @@ def handle_extra_path(self):
7878
def run(self):
7979
# Explicit request for old-style install? Just do it
8080
if self.old_and_unmanageable or self.single_version_externally_managed:
81-
return orig.install.run(self)
81+
return super().run()
8282

8383
if not self._called_from_setup(inspect.currentframe()):
8484
# Run in backward-compatibility mode to support bdist_* commands.
85-
orig.install.run(self)
85+
super().run()
8686
else:
8787
self.do_egg_install()
8888

0 commit comments

Comments
 (0)