Author: Alexander Hesse <[email protected]>
Branch: split-rpython
Changeset: r59797:ec6e57ae881e
Date: 2013-01-05 23:11 +0100
http://bitbucket.org/pypy/pypy/changeset/ec6e57ae881e/

Log:    Moved watchdog to rpython

diff --git a/pypy/tool/watchdog_nt.py b/pypy/tool/watchdog_nt.py
deleted file mode 100644
--- a/pypy/tool/watchdog_nt.py
+++ /dev/null
@@ -1,33 +0,0 @@
-import sys, os
-import threading
-import ctypes
-
-def childkill(pid):
-    global timedout
-    timedout = True
-    sys.stderr.write("==== test running for %d seconds ====\n" % timeout)
-    sys.stderr.write("="*26 + "timedout" + "="*26 + "\n")
-    ctypes.windll.kernel32.TerminateProcess(pid, 1)
-
-if __name__ == '__main__':
-    PROCESS_TERMINATE = 0x1
-
-    timeout = float(sys.argv[1])
-    timedout = False
-
-    pid = os.spawnv(os.P_NOWAIT, sys.argv[2], sys.argv[2:])
-
-    t = threading.Timer(timeout, childkill, (pid,))
-    t.start()
-    while True:
-        try:
-            pid, status = os.waitpid(pid, 0)
-        except KeyboardInterrupt:
-            continue
-        else:
-            t.cancel()
-            break
-
-    #print 'status ', status >> 8
-    sys.exit(status >> 8)
-
diff --git a/pypy/tool/watchdog.py b/rpython/tool/watchdog.py
rename from pypy/tool/watchdog.py
rename to rpython/tool/watchdog.py
diff --git a/rpython/translator/cli/gencli.py b/rpython/translator/cli/gencli.py
--- a/rpython/translator/cli/gencli.py
+++ b/rpython/translator/cli/gencli.py
@@ -91,8 +91,7 @@
         args = [helper] + args
         if timeout and not sys.platform.startswith('win'):
             import os
-            from pypy.conftest import pypydir
-            watchdog = os.path.join(pypydir, 'tool', 'watchdog.py')
+            watchdog = os.path.join(os.path.dirname(__file__), '..', '..', 
'tool', 'watchdog.py')
             args[:0] = [sys.executable, watchdog, str(float(timeout))]
         proc = subprocess.Popen(args, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)
         stdout, stderr = proc.communicate()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to