Skip to content
Snippets Groups Projects
Commit 8a4c673f authored by ale's avatar ale
Browse files

Use py3 print() syntax

parent 6c445b5e
Branches
No related tags found
1 merge request!4Drop Python 2 support
...@@ -70,19 +70,19 @@ def _stop_httpd(httpd): ...@@ -70,19 +70,19 @@ def _stop_httpd(httpd):
status = httpd.wait() status = httpd.wait()
if os.WIFEXITED(status): if os.WIFEXITED(status):
if os.WEXITSTATUS(status) != 0: if os.WEXITSTATUS(status) != 0:
print 'WARNING: httpd exited with status %d' % os.WEXITSTATUS(status) print('WARNING: httpd exited with status %d' % os.WEXITSTATUS(status))
dump_log = True dump_log = True
elif os.WIFSIGNALED(status): elif os.WIFSIGNALED(status):
print 'WARNING: httpd exited due to signal %d' % os.WTERMSIG(status) print('WARNING: httpd exited due to signal %d' % os.WTERMSIG(status))
dump_log = True dump_log = True
else: else:
print 'WARNING: httpd exited for unknown reason (returncode=%d)' % status print('WARNING: httpd exited for unknown reason (returncode=%d)' % status)
dump_log = True dump_log = True
if dump_log: if dump_log:
with open(APACHE_LOG) as fd: with open(APACHE_LOG) as fd:
for line in fd: for line in fd:
print line.rstrip('\n') print(line.rstrip('\n'))
for f in ('public.key', 'test-httpd.pid', '.apache_log'): for f in ('public.key', 'test-httpd.pid', '.apache_log'):
try: try:
...@@ -239,7 +239,7 @@ class HttpdIntegrationTestBase(unittest.TestCase): ...@@ -239,7 +239,7 @@ class HttpdIntegrationTestBase(unittest.TestCase):
] ]
for name, check in checks: for name, check in checks:
for i in xrange(repeats): for i in xrange(repeats):
print 'CHECKING %s (%d of 10)' % (name, i), check print('CHECKING %s (%d of 10)' % (name, i), check)
status, body, location = _query(check["url"], status, body, location = _query(check["url"],
host=check.get("http_host"), host=check.get("http_host"),
cookie=check.get("cookie")) cookie=check.get("cookie"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment