Skip to content
Commits on Source (2)
piuparts (0.97) UNRELEASED; urgency=medium
* ...
[ Herbert Fortes ]
* piuparts.py, piuparts-slave.py, piupartslib/pkgsummary.py and
piuparts-analyze.py: add '()' to print. Py2 and Py3 compatible.
-- Holger Levsen <holger@debian.org> Sun, 13 Jan 2019 16:58:44 +0100
......
......@@ -29,7 +29,7 @@ headers of the log in ./fail to the one in ./bugged and vice versa. It will then
move the failed log to ./bugged as well.
"""
from __future__ import print_function
import os
import sys
......@@ -311,7 +311,7 @@ def mark_logs_with_reported_bugs():
raise
except:
print('ERROR processing %s' % failed_log)
print sys.exc_info()[0]
print(sys.exc_info()[0])
alarm(0)
......
......@@ -22,7 +22,7 @@
Lars Wirzenius <liw@iki.fi>
"""
from __future__ import print_function
import os
import sys
......@@ -115,15 +115,15 @@ def alarm_handler(signum, frame):
def sigint_handler(signum, frame):
global interrupted
interrupted = True
print '\nSlave interrupted by the user, waiting for the current test to finish.'
print 'Press Ctrl-C again to abort now.'
print('\nSlave interrupted by the user, waiting for the current test to finish.')
print('Press Ctrl-C again to abort now.')
signal(SIGINT, old_sigint_handler)
def sighup_handler(signum, frame):
global got_sighup
got_sighup = True
print 'SIGHUP: Will flush finished logs.'
print('SIGHUP: Will flush finished logs.')
class MasterIsBusy(Exception):
......@@ -820,7 +820,7 @@ def run_test_with_timeout(cmd, maxwait, kill_all=True):
stdout, stderr = ps.communicate()
pids.extend([int(pid) for pid in stdout.split()])
if p.poll() is None:
print 'Sending SIGINT...'
print('Sending SIGINT...')
try:
os.killpg(os.getpgid(p.pid), SIGINT)
except OSError:
......@@ -831,7 +831,7 @@ def run_test_with_timeout(cmd, maxwait, kill_all=True):
if p.poll() is not None:
break
if p.poll() is None:
print 'Sending SIGTERM...'
print('Sending SIGTERM...')
p.terminate()
# piuparts has 5 seconds to clean up after SIGTERM
for i in range(10):
......@@ -839,13 +839,13 @@ def run_test_with_timeout(cmd, maxwait, kill_all=True):
if p.poll() is not None:
break
if p.poll() is None:
print 'Sending SIGKILL...'
print('Sending SIGKILL...')
p.kill()
for pid in pids:
if pid > 0:
try:
os.kill(pid, SIGKILL)
print "Killed %d" % pid
print("Killed %d" % pid)
except OSError:
pass
......@@ -864,11 +864,11 @@ def run_test_with_timeout(cmd, maxwait, kill_all=True):
terminate_subprocess(p, kill_all)
return -1, stdout
except KeyboardInterrupt:
print '\nSlave interrupted by the user, cleaning up...'
print('\nSlave interrupted by the user, cleaning up...')
try:
terminate_subprocess(p, kill_all)
except KeyboardInterrupt:
print '\nTerminating piuparts was interrupted... manual cleanup still neccessary.'
print('\nTerminating piuparts was interrupted... manual cleanup still neccessary.')
raise
raise
......@@ -1002,8 +1002,8 @@ if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print ''
print 'Slave interrupted by the user, exiting...'
print('')
print('Slave interrupted by the user, exiting...')
sys.exit(1)
# vi:set et ts=4 sw=4 :
......@@ -30,7 +30,7 @@ more usage information.
Lars Wirzenius <liw@iki.fi>
"""
from __future__ import print_function
VERSION = "__PIUPARTS_VERSION__"
......@@ -3175,7 +3175,7 @@ def main():
# check if user has root privileges
if os.getuid():
print 'You need to be root to use piuparts.'
print('You need to be root to use piuparts.')
sys.exit(1)
logging.info("-" * 78)
......@@ -3230,18 +3230,18 @@ if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print ''
print 'Piuparts interrupted by the user, exiting...'
print('')
print('Piuparts interrupted by the user, exiting...')
panic(1)
sys.exit(1)
except SystemExit:
raise
except:
print ''
print 'Piuparts caught exception, exiting...'
print '-'*60
print('')
print('Piuparts caught exception, exiting...')
print('-'*60)
traceback.print_exc(file=sys.stdout)
print '-'*60
print('-'*60)
panic(1)
raise
......
......@@ -78,7 +78,7 @@
#
# The global file also includes an 'overall' json-section, which contains
# the 'worst' result across the other json-sections.
from __future__ import print_function
import json
import datetime
......@@ -240,4 +240,4 @@ if __name__ == '__main__':
for pkg in summary['packages']:
flag, blocked, url = summary['packages'][pkg][DEFSEC]
print pkg, flag, url, tooltip(summary, pkg)
print(pkg, flag, url, tooltip(summary, pkg))