comparison tests/run-tests.py @ 32303:dc131b9772f2

run-tests: drop fallback for proc.terminate() for pre-py2.6
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 16 May 2017 14:42:13 -0700
parents 8627cf4de929
children b96be0098624
comparison
equal deleted inserted replaced
32302:8627cf4de929 32303:dc131b9772f2
521 print(m, end=' ') 521 print(m, end=' ')
522 print() 522 print()
523 sys.stdout.flush() 523 sys.stdout.flush()
524 524
525 def terminate(proc): 525 def terminate(proc):
526 """Terminate subprocess (with fallback for Python versions < 2.6)""" 526 """Terminate subprocess"""
527 vlog('# Terminating process %d' % proc.pid) 527 vlog('# Terminating process %d' % proc.pid)
528 try: 528 try:
529 getattr(proc, 'terminate', lambda : os.kill(proc.pid, signal.SIGTERM))() 529 proc.terminate()
530 except OSError: 530 except OSError:
531 pass 531 pass
532 532
533 def killdaemons(pidfile): 533 def killdaemons(pidfile):
534 import killdaemons as killmod 534 import killdaemons as killmod