Skip to content

Removing obsolete files from stdlib #2888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 0 additions & 195 deletions Lib/_dummy_thread.py

This file was deleted.

1 change: 0 additions & 1 deletion Lib/distutils/command/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
'bdist',
'bdist_dumb',
'bdist_rpm',
'bdist_wininst',
'check',
'upload',
# These two are reserved for future use:
Expand Down
4 changes: 1 addition & 3 deletions Lib/distutils/command/bdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class bdist(Command):

# Establish the preferred order (for the --help-formats option).
format_commands = ['rpm', 'gztar', 'bztar', 'xztar', 'ztar', 'tar',
'wininst', 'zip', 'msi']
'zip', 'msi']

# And the real information.
format_command = {'rpm': ('bdist_rpm', "RPM distribution"),
Expand All @@ -71,8 +71,6 @@ class bdist(Command):
'xztar': ('bdist_dumb', "xz'ed tar file"),
'ztar': ('bdist_dumb', "compressed tar file"),
'tar': ('bdist_dumb', "tar file"),
'wininst': ('bdist_wininst',
"Windows executable installer"),
'zip': ('bdist_dumb', "ZIP file"),
'msi': ('bdist_msi', "Microsoft Installer")
}
Expand Down
36 changes: 21 additions & 15 deletions Lib/distutils/command/bdist_msi.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (C) 2005, 2006 Martin von Löwis
# Licensed to PSF under a Contributor Agreement.
# The bdist_wininst command proper
# based on bdist_wininst
"""
Implements the bdist_msi command.
"""

import sys, os
import os
import sys
import warnings
from distutils.core import Command
from distutils.dir_util import remove_tree
from distutils.sysconfig import get_python_version
Expand Down Expand Up @@ -122,6 +122,12 @@ class bdist_msi(Command):
'3.5', '3.6', '3.7', '3.8', '3.9']
other_version = 'X'

def __init__(self, *args, **kw):
super().__init__(*args, **kw)
warnings.warn("bdist_msi command is deprecated since Python 3.9, "
"use bdist_wheel (wheel packages) instead",
DeprecationWarning, 2)

def initialize_options(self):
self.bdist_dir = None
self.plat_name = None
Expand Down Expand Up @@ -390,18 +396,18 @@ def add_scripts(self):
# entries for each version as the above code does
if self.pre_install_script:
scriptfn = os.path.join(self.bdist_dir, "preinstall.bat")
f = open(scriptfn, "w")
# The batch file will be executed with [PYTHON], so that %1
# is the path to the Python interpreter; %0 will be the path
# of the batch file.
# rem ="""
# %1 %0
# exit
# """
# <actual script>
f.write('rem ="""\n%1 %0\nexit\n"""\n')
f.write(open(self.pre_install_script).read())
f.close()
with open(scriptfn, "w") as f:
# The batch file will be executed with [PYTHON], so that %1
# is the path to the Python interpreter; %0 will be the path
# of the batch file.
# rem ="""
# %1 %0
# exit
# """
# <actual script>
f.write('rem ="""\n%1 %0\nexit\n"""\n')
with open(self.pre_install_script) as fin:
f.write(fin.read())
add_data(self.db, "Binary",
[("PreInstall", msilib.Binary(scriptfn))
])
Expand Down
9 changes: 3 additions & 6 deletions Lib/distutils/command/bdist_rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import subprocess, sys, os
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.util import get_platform
from distutils.file_util import write_file
from distutils.errors import *
from distutils.sysconfig import get_python_version
Expand Down Expand Up @@ -309,10 +308,7 @@ def run(self):

# build package
log.info("building RPMs")
rpm_cmd = ['rpm']
if os.path.exists('/usr/bin/rpmbuild') or \
os.path.exists('/bin/rpmbuild'):
rpm_cmd = ['rpmbuild']
rpm_cmd = ['rpmbuild']

if self.source_only: # what kind of RPMs?
rpm_cmd.append('-bs')
Expand Down Expand Up @@ -537,7 +533,8 @@ def _make_spec_file(self):
'',
'%' + rpm_opt,])
if val:
spec_file.extend(open(val, 'r').read().split('\n'))
with open(val) as f:
spec_file.extend(f.read().split('\n'))
else:
spec_file.append(default)

Expand Down
Loading