Skip to content

Commit

Permalink
Merge pull request #1986 from vstinner/skip_wininst
Browse files Browse the repository at this point in the history
Fix install_scripts() if bdist_wininst is missing
  • Loading branch information
jaraco committed Feb 5, 2020
2 parents 54b76e6 + b0ecd44 commit 5d17586
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/1985.change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for installing scripts in environments where bdist_wininst is missing (i.e. Python 3.9).
7 changes: 5 additions & 2 deletions setuptools/command/install_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ def run(self):
)
bs_cmd = self.get_finalized_command('build_scripts')
exec_param = getattr(bs_cmd, 'executable', None)
bw_cmd = self.get_finalized_command("bdist_wininst")
is_wininst = getattr(bw_cmd, '_is_running', False)
try:
bw_cmd = self.get_finalized_command("bdist_wininst")
is_wininst = getattr(bw_cmd, '_is_running', False)
except ImportError:
is_wininst = False
writer = ei.ScriptWriter
if is_wininst:
exec_param = "python.exe"
Expand Down

0 comments on commit 5d17586

Please sign in to comment.