mirror of
https://github.com/python/cpython.git
synced 2025-07-31 07:04:42 +00:00
Fixed import of configparser in the distutils module.
If configparser is unavailable, try to import configparser using its old name. This is required for backward-compatibility with older Python versions.
This commit is contained in:
parent
fa40bbf625
commit
eb8cef2664
3 changed files with 16 additions and 4 deletions
|
@ -5,7 +5,11 @@ that uses .pypirc in the distutils.command package.
|
|||
"""
|
||||
import os
|
||||
import sys
|
||||
from ConfigParser import ConfigParser
|
||||
try:
|
||||
from configparser import ConfigParser
|
||||
except ImportError:
|
||||
# For backward-compatibility with Python versions < 2.6.
|
||||
from ConfigParser import ConfigParser
|
||||
|
||||
from distutils.cmd import Command
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue