Commit 850d4fae authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-37481: Deprecate distutils bdist_wininst command (GH-14553)

The distutils bdist_wininst command is now deprecated, use
bdist_wheel (wheel packages) instead.
parent 6b9a31e6
......@@ -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
......
......@@ -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,6 +21,7 @@ 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()
with check_warnings(("", DeprecationWarning)):
cmd = bdist_wininst(dist)
cmd.ensure_finalized()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment