summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2022-04-09 00:15:35 (GMT)
committerGitHub <noreply@github.com>2022-04-09 00:15:35 (GMT)
commitcd29bd13ef1fe18970c5d43b66c545dd03117cb9 (patch)
treecc111c2bf79956a6a8680f53500662cb2511081b /Lib/distutils
parent1c8b3b5d66a629258f1db16939b996264a8b9c37 (diff)
downloadcpython-cd29bd13ef1fe18970c5d43b66c545dd03117cb9.zip
cpython-cd29bd13ef1fe18970c5d43b66c545dd03117cb9.tar.gz
cpython-cd29bd13ef1fe18970c5d43b66c545dd03117cb9.tar.bz2
bpo-47061: deprecate cgi and cgitb (GH-32410)
Part of PEP 594.
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/config.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/distutils/config.py b/Lib/distutils/config.py
index 2171abd..a201c86 100644
--- a/Lib/distutils/config.py
+++ b/Lib/distutils/config.py
@@ -5,6 +5,7 @@ that uses .pypirc in the distutils.command package.
"""
import os
from configparser import RawConfigParser
+import warnings
from distutils.cmd import Command
@@ -111,7 +112,9 @@ class PyPIRCCommand(Command):
def _read_pypi_response(self, response):
"""Read and decode a PyPI HTTP response."""
- import cgi
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ import cgi
content_type = response.getheader('content-type', 'text/plain')
encoding = cgi.parse_header(content_type)[1].get('charset', 'ascii')
return response.read().decode(encoding)