Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8bfba84

Browse files
committed
Issue #28783: Replaces bdist_wininst in nuget packages with stub
2 parents 0f6373c + b227227 commit 8bfba84

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
@@ -79,10 +79,6 @@ def include_in_lib(p):
7979
if name in EXCLUDE_FILE_FROM_LIBRARY:
8080
return False
8181

82-
# Special code is included below to patch this file back in
83-
if [d.lower() for d in p.parts[-3:]] == ['distutils', 'command', '__init__.py']:
84-
return False
85-
8682
suffix = p.suffix.lower()
8783
return suffix not in {'.pyc', '.pyo', '.exe'}
8884

@@ -218,8 +214,8 @@ def main():
218214
extra_files = []
219215
if s == 'Lib' and p == '**/*':
220216
extra_files.append((
221-
source / 'tools' / 'msi' / 'distutils.command.__init__.py',
222-
Path('distutils') / 'command' / '__init__.py'
217+
source / 'tools' / 'msi' / 'distutils.command.bdist_wininst.py',
218+
Path('distutils') / 'command' / 'bdist_wininst.py'
223219
))
224220
copied = copy_to_layout(temp / t.rstrip('/'), chain(files, extra_files))
225221
print('Copied {} files'.format(copied))

0 commit comments

Comments
 (0)