[Python-checkins] cpython (3.3): Fix bootstrap issue by importing the cgi module lazily

antoine.pitrou python-checkins at python.org
Sun Dec 22 19:41:38 CET 2013


http://hg.python.org/cpython/rev/3c449a0cd4eb
changeset: 88131:3c449a0cd4eb
branch: 3.3
parent: 88129:bb42e10a5620
user: Antoine Pitrou <solipsis at pitrou.net>
date: Sun Dec 22 19:37:17 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
 
@@ -104,6 +103,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

AltStyle によって変換されたページ (->オリジナル) /