from .vcs.git import GitBackend as _GitBackend
try:
from .vcs.bazaar import BazaarBackend as _BazaarBackend
-except ImportError, _bazaar_import_error:
+except ImportError as _bazaar_import_error:
_BazaarBackend = None
try:
from .vcs.mercurial import MercurialBackend as _MercurialBackend
-except ImportError, _mercurial_import_error:
+except ImportError as _mercurial_import_error:
_MercurialBackend = None
clean_section = section.replace('-', '_')
try:
loader = getattr(self, '_load_{}_conf'.format(clean_section))
- except AttributeError, e:
+ except AttributeError as e:
_LOG.error('invalid {} section'.format(section))
raise
loader(parser=parser)
for i,paragraph in enumerate(text):
try:
text[i] = paragraph % info
- except ValueError, e:
+ except ValueError as e:
_LOG.error(
"{}: can't format {} with {}".format(e, paragraph, info))
raise
- except TypeError, e:
+ except TypeError as e:
_LOG.error(
('{}: copright text must be a list of paragraph strings, '
'not {}').format(e, repr(text)))
q = _subprocess.Popen(args, stdin=_subprocess.PIPE,
stdout=stdout, stderr=stderr, shell=True,
cwd=cwd)
- except OSError, e:
+ except OSError as e:
raise ValueError([args, e])
stdout,stderr = q.communicate(input=stdin)
status = q.wait()