mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Fix bootstrap issue by importing the cgi module lazily
This commit is contained in:
commit
5bf8c3477d
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue