[PATCH 1 of 8 py3-cleanup] run-tests: drop wifexited polyfill

Augie Fackler raf at durin42.com
Mon May 18 15:58:40 UTC 2015


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1431911704 14400
#      Sun May 17 21:15:04 2015 -0400
# Node ID 57acc2e6aa0e382289b2e872df7416dbf229c714
# Parent  0851b94ffcd70276eafaa3b19aadae60da9d72fa
run-tests: drop wifexited polyfill

os.WIFEXITED exists as of python 2.6 for me, so we no longer need this
polyfill.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -87,8 +87,6 @@ if sys.version_info > (3, 0, 0):
 if sys.version_info < (2, 5):
     subprocess._cleanup = lambda: None
 
-wifexited = getattr(os, "WIFEXITED", lambda x: False)
-
 def checkportisavailable(port):
     """return true if a port seems free to bind on localhost"""
     try:
@@ -789,7 +787,7 @@ class Test(unittest.TestCase):
             raise
 
         ret = proc.wait()
-        if wifexited(ret):
+        if os.WIFEXITED(ret):
             ret = os.WEXITSTATUS(ret)
 
         if proc.timeout:
@@ -890,7 +888,7 @@ class TTest(Test):
                       self._testtmp, 0, self._getenv())
         stdout, stderr = proc.communicate()
         ret = proc.wait()
-        if wifexited(ret):
+        if os.WIFEXITED(ret):
             ret = os.WEXITSTATUS(ret)
         if ret == 2:
             print(stdout)


More information about the Mercurial-devel mailing list