Browse Source

revert setup file to use process killing

Patrick Falls 12 years ago
parent
commit
6e698f2b1c
1 changed files with 10 additions and 7 deletions
  1. 10 7
      flask/setup_pypy.py

+ 10 - 7
flask/setup_pypy.py

@@ -12,10 +12,13 @@ def start(args):
   return 0
   return 0
 
 
 def stop():
 def stop():
-  global proc
-  if not proc:
-    return 0
-  proc.terminate()
-  ret = proc.wait()
-  proc = None
-  return ret
+  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+  out, err = p.communicate()
+  for line in out.splitlines():
+    if 'pypy' in line and 'run-tests' not in line:
+      try:
+        pid = int(line.split(None, 2)[1])
+        os.kill(pid, 9)
+      except OSError:
+        pass
+  return 0