diff --git a/certbot_haproxy/installer.py b/certbot_haproxy/installer.py index bfdf1f9..47eb149 100644 --- a/certbot_haproxy/installer.py +++ b/certbot_haproxy/installer.py @@ -523,7 +523,7 @@ class HAProxyInstaller(common.Plugin): contents = pem.read() if self._cert_key_check(contents, filepath): yield (filepath, filepath, self.conf("haproxy-config")) - except IOError, err: + except IOError as err: logger.error( "Can't access \"%s\", reason:\n %s", filepath, @@ -544,7 +544,7 @@ class HAProxyInstaller(common.Plugin): except TypeError: logger.warn("Could not read certificate, wrong type (not PEM)") # Documentation says it raises "Error" - except Exception, err: # pylint: disable=broad-except + except Exception as err: # pylint: disable=broad-except logger.error("Unexpected error! %s", err) if issuer == self.conf('haproxy-ca-common-name') and key.check(): diff --git a/certbot_haproxy/tests/__init__.py b/certbot_haproxy/tests/__init__.py index 09efe79..39c364b 100644 --- a/certbot_haproxy/tests/__init__.py +++ b/certbot_haproxy/tests/__init__.py @@ -1,4 +1,5 @@ """Certbot HAProxy Tests""" +from __future__ import print_function import unittest @@ -6,7 +7,7 @@ def load_tests(loader, tests, pattern=None): """Find all python files in the tests folder""" if pattern is None: pattern = 'test_*.py' - print "loader: ", loader + print("loader: ", loader) suite = loader.discover('certbot_haproxy/tests', pattern=pattern) suite.addTests(tests)