[Python-checkins] bpo-44781: make distutils test suppress deprecation warning from import distutils (GH-27485) (GH-27540)

ambv webhook-mailer at python.org
Mon Aug 2 05:54:56 EDT 2021


https://github.com/python/cpython/commit/1bc83eb5c8040855de425c68fc9c5d3c5b48d38e
commit: 1bc83eb5c8040855de425c68fc9c5d3c5b48d38e
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2021-08-02T11:54:52+02:00
summary:

bpo-44781: make distutils test suppress deprecation warning from import distutils (GH-27485) (GH-27540)

(cherry picked from commit a9134fa2ffb7e4684c980325dd5444afca596586)

Co-authored-by: Irit Katriel <1055913+iritkatriel at users.noreply.github.com>

files:
M Lib/distutils/tests/test_bdist.py

diff --git a/Lib/distutils/tests/test_bdist.py b/Lib/distutils/tests/test_bdist.py
index 09ad076799b420..55fa3930dd92f2 100644
--- a/Lib/distutils/tests/test_bdist.py
+++ b/Lib/distutils/tests/test_bdist.py
@@ -3,8 +3,11 @@
 import unittest
 from test.support import run_unittest
 
-from distutils.command.bdist import bdist
-from distutils.tests import support
+import warnings
+with warnings.catch_warnings():
+    warnings.simplefilter('ignore', DeprecationWarning)
+    from distutils.command.bdist import bdist
+    from distutils.tests import support
 
 
 class BuildTestCase(support.TempdirManager,



More information about the Python-checkins mailing list