[Python-checkins] cpython (merge 3.3 -> default): Fix bootstrap issue by importing the cgi module lazily
antoine.pitrou
python-checkins at python.org
Sun Dec 22 19:41:39 CET 2013
http://hg.python.org/cpython/rev/12197b52cb65
changeset: 88132:12197b52cb65
parent: 88130:d69ba246a3e4
parent: 88131:3c449a0cd4eb
user: Antoine Pitrou <solipsis at pitrou.net>
date: Sun Dec 22 19:41:31 2013 +0100
summary:
Fix bootstrap issue by importing the cgi module lazily
files:
Lib/distutils/config.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Lib/distutils/config.py b/Lib/distutils/config.py
--- a/Lib/distutils/config.py
+++ b/Lib/distutils/config.py
@@ -3,7 +3,6 @@
Provides the PyPIRCCommand class, the base class for the command classes
that uses .pypirc in the distutils.command package.
"""
-import cgi
import os
from configparser import ConfigParser
@@ -113,6 +112,7 @@
def _read_pypi_response(self, response):
"""Read and decode a PyPI HTTP response."""
+ 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)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list