Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e62a404

Browse files
committed
Fix bootstrap issue by importing the cgi module lazily
1 parent 335a512 commit e62a404

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/distutils/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
Provides the PyPIRCCommand class, the base class for the command classes
44
that uses .pypirc in the distutils.command package.
55
"""
6-
import cgi
76
import os
87
from configparser import ConfigParser
98

@@ -104,6 +103,7 @@ def _read_pypirc(self):
104103

105104
def _read_pypi_response(self, response):
106105
"""Read and decode a PyPI HTTP response."""
106+
import cgi
107107
content_type = response.getheader('content-type', 'text/plain')
108108
encoding = cgi.parse_header(content_type)[1].get('charset', 'ascii')
109109
return response.read().decode(encoding)

0 commit comments

Comments
 (0)