From 8ee4e0365d4d31b4d0b42511567fa2c2657dcdcb Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sun, 22 Dec 2013 19:37:17 +0100 Subject: Fix bootstrap issue by importing the cgi module lazily --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.py') diff --git a/config.py b/config.py index 7e10fff9..106e1465 100644 --- a/config.py +++ b/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 @@ 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) -- cgit v1.2.1