diff options
| -rw-r--r-- | changelog.d/1985.change.rst | 1 | ||||
| -rw-r--r-- | setuptools/command/install_scripts.py | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/changelog.d/1985.change.rst b/changelog.d/1985.change.rst new file mode 100644 index 00000000..33698b88 --- /dev/null +++ b/changelog.d/1985.change.rst @@ -0,0 +1 @@ +Add support for installing scripts in environments where bdist_wininst is missing (i.e. Python 3.9). diff --git a/setuptools/command/install_scripts.py b/setuptools/command/install_scripts.py index 16234273..8c9a15e2 100644 --- a/setuptools/command/install_scripts.py +++ b/setuptools/command/install_scripts.py @@ -32,8 +32,11 @@ class install_scripts(orig.install_scripts): ) 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" |
