summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-07-25 08:49:52 -0700
committerMonty Taylor <mordred@inaugust.com>2013-07-25 10:09:17 -0700
commit37f5b545aebf9ddeaf005c5718d77c31dd81032f (patch)
tree6bcf218751b4c94cfbd659bbd974323193d51d4a
parent2efd8ba8e234923a57b3220398873202dc11835d (diff)
downloadpbr-37f5b545aebf9ddeaf005c5718d77c31dd81032f.tar.gz
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
-rw-r--r--pbr/tests/util.py4
-rw-r--r--pbr/util.py4
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