From 2167911d023b26ce19573e10607a5476d609be9b Mon Sep 17 00:00:00 2001 From: Uggla Date: Mon, 6 Feb 2017 17:39:29 +0100 Subject: [PATCH] Fix import of configparser to allow pip installation Change-Id: I40a0f40adff422dc6227c15106e10b1589c2bf99 --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d2a416b..e094ed5 100755 --- a/setup.py +++ b/setup.py @@ -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