Commit 64cd7c2b authored by Denis Bilenko's avatar Denis Bilenko

add greetest/mysubprocess.py that backports Popen.kill() method

parent 3877ef9a
import sys
import subprocess
from subprocess import *
class Popen(subprocess.Popen):
if not hasattr(subprocess.Popen, 'kill'):
def kill(self):
try:
from os import kill
sys.stderr.write('Sending signal 9 to %s\n' % self.pid)
kill(self.pid, 9)
except ImportError:
sys.stderr.write('Cannot kill on this platform. Please kill %s\n' % self.pid)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment