Make exception syntax Python 3 compatible.

Translate all except and raise statements that are in the old form to
the Python 3 compatible format.
This commit is contained in:
Roy Wellington Ⅳ
2016-01-30 19:53:50 -08:00
parent e581335073
commit 9c28364477
8 changed files with 18 additions and 17 deletions
@@ -85,12 +85,12 @@ def _vhost_menu(domain, vhosts):
"or Address of {0}.{1}Which virtual host would you "
"like to choose?".format(domain, os.linesep),
choices, help_label="More Info", ok_label="Select")
except errors.MissingCommandlineFlag, e:
except errors.MissingCommandlineFlag as e:
msg = ("Failed to run Apache plugin non-interactively{1}{0}{1}"
"(The best solution is to add ServerName or ServerAlias "
"entries to the VirtualHost directives of your apache "
"configuration files.)".format(e, os.linesep))
raise errors.MissingCommandlineFlag, msg
raise errors.MissingCommandlineFlag(msg)
return code, tag
@@ -37,7 +37,7 @@ class SelectVhostTest(unittest.TestCase):
mock_util().menu.side_effect = errors.MissingCommandlineFlag("no vhost default")
try:
self._call(self.vhosts)
except errors.MissingCommandlineFlag, e:
except errors.MissingCommandlineFlag as e:
self.assertTrue("VirtualHost directives" in e.message)
@mock.patch("letsencrypt_apache.display_ops.zope.component.getUtility")