Fix import of configparser to allow pip installation
Change-Id: I40a0f40adff422dc6227c15106e10b1589c2bf99
This commit is contained in:
parent
df87d4c836
commit
2167911d02
8
setup.py
8
setup.py
@ -30,12 +30,18 @@ except ImportError:
|
|||||||
from future import standard_library
|
from future import standard_library
|
||||||
from builtins import object
|
from builtins import object
|
||||||
import distutils
|
import distutils
|
||||||
import configparser
|
|
||||||
import setuptools
|
import setuptools
|
||||||
from setuptools import Distribution
|
from setuptools import Distribution
|
||||||
from setuptools.command.install import install
|
from setuptools.command.install import install
|
||||||
standard_library.install_aliases()
|
standard_library.install_aliases()
|
||||||
|
|
||||||
|
# Trick to allow pip installation
|
||||||
|
major, minor = sys.version_info[:2]
|
||||||
|
if major == 2:
|
||||||
|
import ConfigParser as configparser
|
||||||
|
else:
|
||||||
|
import configparser
|
||||||
|
|
||||||
# In python < 2.7.4, a lazy loading of package `pbr` will break
|
# In python < 2.7.4, a lazy loading of package `pbr` will break
|
||||||
# setuptools if some other modules registered functions in `atexit`.
|
# setuptools if some other modules registered functions in `atexit`.
|
||||||
# solution from: http://bugs.python.org/issue15881#msg170215
|
# solution from: http://bugs.python.org/issue15881#msg170215
|
||||||
|
Loading…
x
Reference in New Issue
Block a user