From 37f5b545aebf9ddeaf005c5718d77c31dd81032f Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 25 Jul 2013 08:49:52 -0700 Subject: Swap the order of configparser imports The configparser backport package has un-understood issues parsing our files. But the intent of the code is to use whichever is the package for the version of python in use. So, instead of trying to install the python3 version first, which can also result in loading the backport package, first try the python2 package, so that if configparser itself is loaded, it will be because we're running python3. Change-Id: I7ef497127822d0110804b04a674f24c195a07278 --- pbr/tests/util.py | 4 ++-- pbr/util.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pbr/tests/util.py b/pbr/tests/util.py index e657508..de5a740 100644 --- a/pbr/tests/util.py +++ b/pbr/tests/util.py @@ -44,9 +44,9 @@ import shutil import stat try: - import configparser -except ImportError: import ConfigParser as configparser +except ImportError: + import configparser @contextlib.contextmanager diff --git a/pbr/util.py b/pbr/util.py index 3faa58e..6339116 100644 --- a/pbr/util.py +++ b/pbr/util.py @@ -73,9 +73,9 @@ from setuptools.dist import Distribution from setuptools.extension import Extension try: - import configparser -except ImportError: import ConfigParser as configparser +except ImportError: + import configparser import pbr.hooks -- cgit v1.2.1