diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-07-05 09:03:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-05 09:03:23 (GMT) |
commit | b4cd6ba1a028c2624ac7bc93439b9d45f51cfeba (patch) | |
tree | 50179251566e12591c2362057926539beadda947 /Lib/distutils | |
parent | c3ef1a5244ff2a5d25b7186b96d027a446bf0452 (diff) | |
download | cpython-b4cd6ba1a028c2624ac7bc93439b9d45f51cfeba.zip cpython-b4cd6ba1a028c2624ac7bc93439b9d45f51cfeba.tar.gz cpython-b4cd6ba1a028c2624ac7bc93439b9d45f51cfeba.tar.bz2 |
bpo-37481: Deprecate distutils bdist_wininst command (GH-14553)
The distutils bdist_wininst command is now deprecated, use
bdist_wheel (wheel packages) instead.
(cherry picked from commit 1da4462765b084dfa8d869b6cb5855e8f6014a11)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/command/bdist_wininst.py | 10 | ||||
-rw-r--r-- | Lib/distutils/tests/test_bdist_wininst.py | 5 |
2 files changed, 12 insertions, 3 deletions
diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py index acaa184..b5ed6f0 100644 --- a/Lib/distutils/command/bdist_wininst.py +++ b/Lib/distutils/command/bdist_wininst.py @@ -3,7 +3,9 @@ Implements the Distutils 'bdist_wininst' command: create a windows installer exe-program.""" -import sys, os +import os +import sys +import warnings from distutils.core import Command from distutils.util import get_platform from distutils.dir_util import create_tree, remove_tree @@ -58,6 +60,12 @@ class bdist_wininst(Command): # bpo-10945: bdist_wininst requires mbcs encoding only available on Windows _unsupported = (sys.platform != "win32") + def __init__(self, *args, **kw): + super().__init__(*args, **kw) + warnings.warn("bdist_wininst command is deprecated since Python 3.8, " + "use bdist_wheel (wheel packages) instead", + DeprecationWarning, 2) + def initialize_options(self): self.bdist_dir = None self.plat_name = None diff --git a/Lib/distutils/tests/test_bdist_wininst.py b/Lib/distutils/tests/test_bdist_wininst.py index 163f1cc..5c3d025 100644 --- a/Lib/distutils/tests/test_bdist_wininst.py +++ b/Lib/distutils/tests/test_bdist_wininst.py @@ -2,7 +2,7 @@ import sys import platform import unittest -from test.support import run_unittest +from test.support import run_unittest, check_warnings from distutils.command.bdist_wininst import bdist_wininst from distutils.tests import support @@ -21,7 +21,8 @@ class BuildWinInstTestCase(support.TempdirManager, # this test makes sure it works now for every platform # let's create a command pkg_pth, dist = self.create_dist() - cmd = bdist_wininst(dist) + with check_warnings(("", DeprecationWarning)): + cmd = bdist_wininst(dist) cmd.ensure_finalized() # let's run the code that finds the right wininst*.exe file |