summaryrefslogtreecommitdiff
path: root/pbr/d2to1/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'pbr/d2to1/util.py')
-rw-r--r--pbr/d2to1/util.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/pbr/d2to1/util.py b/pbr/d2to1/util.py
index a95adcf..4e14c13 100644
--- a/pbr/d2to1/util.py
+++ b/pbr/d2to1/util.py
@@ -28,10 +28,9 @@ from distutils.errors import (DistutilsOptionError, DistutilsModuleError,
from setuptools.command.egg_info import manifest_maker
from setuptools.dist import Distribution
from setuptools.extension import Extension
-try:
- from ConfigParser import RawConfigParser
-except ImportError:
- from configparser import RawConfigParser
+
+from .extern.six import moves as m
+RawConfigParser = m.configparser.RawConfigParser
# A simplified RE for this; just checks that the line ends with version
@@ -173,7 +172,8 @@ def cfg_to_args(path='setup.cfg'):
hook_fn = resolve_name(hook)
try :
hook_fn(config)
- except Exception, e:
+ except:
+ e = sys.exc_info()[1]
log.error('setup hook %s raised exception: %s\n' %
(hook, e))
log.error(traceback.format_exc())
@@ -492,7 +492,8 @@ def run_command_hooks(cmd_obj, hook_kind):
try :
hook_obj(cmd_obj)
- except Exception, e :
+ except:
+ e = sys.exc_info()[1]
log.error('hook %s raised exception: %s\n' % (hook, e))
log.error(traceback.format_exc())
sys.exit(1)