# HG changeset patch # User Augie Fackler # Date 1311629838 18000 # Node ID a50ed14997fc1e9d2d285e8f74b125ac65fcd741 # Parent 98fa0fa48b7d67f8023d8de39bc54d4a7b50b97e tests: use getattr instead of hasattr [ original upstream message ] diff -r 98fa0fa48b7d -r a50ed14997fc tests/run-tests.py --- a/tests/run-tests.py Wed Jul 13 19:23:08 2011 +0200 +++ b/tests/run-tests.py Mon Jul 25 16:37:18 2011 -0500 @@ -340,10 +340,7 @@ """Terminate subprocess (with fallback for Python versions < 2.6)""" vlog('# Terminating process %d' % proc.pid) try: - if hasattr(proc, 'terminate'): - proc.terminate() - else: - os.kill(proc.pid, signal.SIGTERM) + getattr(proc, 'terminate', lambda : os.kill(proc.pid, signal.SIGTERM))() except OSError: pass