Skip to content

Commit e711cc0

Browse files
committed
Issue #28783: Replaces bdist_wininst in nuget packages with stub
1 parent 8b58339 commit e711cc0

3 files changed

Lines changed: 22 additions & 38 deletions

File tree

Tools/msi/distutils.command.__init__.py

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""distutils.command.bdist_wininst
2+
3+
Suppresses the 'bdist_wininst' command, while still allowing
4+
setuptools to import it without breaking."""
5+
6+
from distutils.core import Command
7+
from distutils.errors import DistutilsPlatformError
8+
9+
class bdist_wininst(Command):
10+
description = "create an executable installer for MS Windows"
11+
12+
def initialize_options(self):
13+
pass
14+
15+
def finalize_options(self):
16+
pass
17+
18+
def run(self):
19+
raise DistutilsPlatformError("bdist_wininst is not supported "
20+
"in this Python distribution")

Tools/msi/make_zip.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ def include_in_lib(p):
7575
if name in EXCLUDE_FILE_FROM_LIBRARY:
7676
return False
7777

78-
# Special code is included below to patch this file back in
79-
if [d.lower() for d in p.parts[-3:]] == ['distutils', 'command', '__init__.py']:
80-
return False
81-
8278
suffix = p.suffix.lower()
8379
return suffix not in {'.pyc', '.pyo', '.exe'}
8480

@@ -215,8 +211,8 @@ def main():
215211
extra_files = []
216212
if s == 'Lib' and p == '**/*':
217213
extra_files.append((
218-
source / 'tools' / 'msi' / 'distutils.command.__init__.py',
219-
Path('distutils') / 'command' / '__init__.py'
214+
source / 'tools' / 'msi' / 'distutils.command.bdist_wininst.py',
215+
Path('distutils') / 'command' / 'bdist_wininst.py'
220216
))
221217
copied = copy_to_layout(temp / t.rstrip('/'), chain(files, extra_files))
222218
print('Copied {} files'.format(copied))

0 commit comments

Comments
 (0)