summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2020-02-10 13:26:40 (GMT)
committerGitHub <noreply@github.com>2020-02-10 13:26:40 (GMT)
commit29b3fc0a18f105de666fdd586b537f34e349766d (patch)
tree0492c7ec4d028639fbe6d139c343140597d7409e /Lib/distutils
parent5305cc9dbfe8a5a0ab666511f3ba7f026c8983f8 (diff)
downloadcpython-29b3fc0a18f105de666fdd586b537f34e349766d.zip
cpython-29b3fc0a18f105de666fdd586b537f34e349766d.tar.gz
cpython-29b3fc0a18f105de666fdd586b537f34e349766d.tar.bz2
bpo-39586: Deprecate distutils bdist_msi command (GH-18415)
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/command/bdist_msi.py10
-rw-r--r--Lib/distutils/tests/test_bdist_msi.py5
2 files changed, 12 insertions, 3 deletions
diff --git a/Lib/distutils/command/bdist_msi.py b/Lib/distutils/command/bdist_msi.py
index f335a34..0863a18 100644
--- a/Lib/distutils/command/bdist_msi.py
+++ b/Lib/distutils/command/bdist_msi.py
@@ -6,7 +6,9 @@
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
@@ -122,6 +124,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
diff --git a/Lib/distutils/tests/test_bdist_msi.py b/Lib/distutils/tests/test_bdist_msi.py
index 15d8bdf..418e60e 100644
--- a/Lib/distutils/tests/test_bdist_msi.py
+++ b/Lib/distutils/tests/test_bdist_msi.py
@@ -1,7 +1,7 @@
"""Tests for distutils.command.bdist_msi."""
import sys
import unittest
-from test.support import run_unittest
+from test.support import run_unittest, check_warnings
from distutils.tests import support
@@ -14,7 +14,8 @@ class BDistMSITestCase(support.TempdirManager,
# minimal test XXX need more tests
from distutils.command.bdist_msi import bdist_msi
project_dir, dist = self.create_dist()
- cmd = bdist_msi(dist)
+ with check_warnings(("", DeprecationWarning)):
+ cmd = bdist_msi(dist)
cmd.ensure_finalized()