Fix import of configparser to allow pip installation

Change-Id: I40a0f40adff422dc6227c15106e10b1589c2bf99
This commit is contained in:
Uggla 2017-02-06 17:39:29 +01:00
parent df87d4c836
commit 2167911d02

View File

@ -30,12 +30,18 @@ except ImportError:
from future import standard_library
from builtins import object
import distutils
import configparser
import setuptools
from setuptools import Distribution
from setuptools.command.install import install
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
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215