diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2013-12-22 19:41:31 +0100 |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-12-22 19:41:31 +0100 |
| commit | 5bf8c3477dd231ecf8e67dea29f0b5e5aa4c0550 (patch) | |
| tree | 29143043ebf85ff1a996040194b13e6543bd2f6c /Lib | |
| parent | 20d5adea6a9dd5a752f2d8bb2b0cef0ee7cf386e (diff) | |
| parent | e62a40401ddfd45ca70d4971e9ad05d4af4f6d78 (diff) | |
| download | cpython-git-5bf8c3477dd231ecf8e67dea29f0b5e5aa4c0550.tar.gz | |
Fix bootstrap issue by importing the cgi module lazily
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/distutils/config.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/distutils/config.py b/Lib/distutils/config.py index 9440190ac8..382aca8fc1 100644 --- 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 @@ class PyPIRCCommand(Command): 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) |
