[Python-checkins] gh-91217: deprecate msilib (GH-91515)

brettcannon webhook-mailer at python.org
Thu Apr 14 15:50:20 EDT 2022


https://github.com/python/cpython/commit/1b6cd872f440ee99989debc1bdecd8bea5a368bf
commit: 1b6cd872f440ee99989debc1bdecd8bea5a368bf
branch: main
author: Brett Cannon <brett at python.org>
committer: brettcannon <brett at python.org>
date: 2022-04-14T12:50:11-07:00
summary:

gh-91217: deprecate msilib (GH-91515)

files:
A Misc/NEWS.d/next/Library/2022-04-12-19-42-20.gh-issue-91217.b9_Rz9.rst
M Doc/whatsnew/3.11.rst
M Lib/msilib/__init__.py
M Lib/test/test_msilib.py

diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index 894ec8a9d0d92..f8e86f6ba349b 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -857,6 +857,7 @@ Deprecated
   * :mod:`chunk`
   * :mod:`crypt`
   * :mod:`imghdr`
+  * :mod:`msilib`
 
   (Contributed by Brett Cannon in :issue:`47061`.)
 
diff --git a/Lib/msilib/__init__.py b/Lib/msilib/__init__.py
index 0e85aa28967ea..565bf631abd4e 100644
--- a/Lib/msilib/__init__.py
+++ b/Lib/msilib/__init__.py
@@ -6,6 +6,9 @@
 import re
 import string
 import sys
+import warnings
+
+warnings._deprecated(__name__, remove=(3, 13))
 
 AMD64 = "AMD64" in sys.version
 # Keep msilib.Win64 around to preserve backwards compatibility.
diff --git a/Lib/test/test_msilib.py b/Lib/test/test_msilib.py
index e29cd4a84c546..db16f62a4c121 100644
--- a/Lib/test/test_msilib.py
+++ b/Lib/test/test_msilib.py
@@ -3,7 +3,10 @@
 import unittest
 from test.support.import_helper import import_module
 from test.support.os_helper import TESTFN, unlink
-msilib = import_module('msilib')
+import warnings
+with warnings.catch_warnings():
+    warnings.simplefilter("ignore", DeprecationWarning)
+    msilib = import_module('msilib')
 import msilib.schema
 
 
diff --git a/Misc/NEWS.d/next/Library/2022-04-12-19-42-20.gh-issue-91217.b9_Rz9.rst b/Misc/NEWS.d/next/Library/2022-04-12-19-42-20.gh-issue-91217.b9_Rz9.rst
new file mode 100644
index 0000000000000..ee1fc22deaef0
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-04-12-19-42-20.gh-issue-91217.b9_Rz9.rst
@@ -0,0 +1 @@
+Deprecate msilib.



More information about the Python-checkins mailing list