Esempio n. 1
0
 def test_os_kill(self):
     import subprocess
     import signal
     proc = subprocess.Popen([sys.executable, "-c",
                          "import time;"
                          "time.sleep(10)",
                          ],
                         )
     rposix.kill(proc.pid, signal.SIGTERM)
     if os.name == 'nt':
         expected = signal.SIGTERM
     else:
         expected = -signal.SIGTERM
     assert proc.wait() == expected
Esempio n. 2
0
 def test_os_kill(self):
     import subprocess
     import signal
     proc = subprocess.Popen([sys.executable, "-c",
                          "import time;"
                          "time.sleep(10)",
                          ],
                         )
     rposix.kill(proc.pid, signal.SIGTERM)
     if os.name == 'nt':
         expected = signal.SIGTERM
     else:
         expected = -signal.SIGTERM
     assert proc.wait() == expected
Esempio n. 3
0
def abort(space):
    """Abort the interpreter immediately.  This 'dumps core' or otherwise fails
in the hardest way possible on the hosting operating system."""
    import signal
    rposix.kill(os.getpid(), signal.SIGABRT)
Esempio n. 4
0
def kill(space, pid, sig):
    "Kill a process with a signal."
    try:
        rposix.kill(pid, sig)
    except OSError as e:
        raise wrap_oserror(space, e)
Esempio n. 5
0
def abort(space):
    """Abort the interpreter immediately.  This 'dumps core' or otherwise fails
in the hardest way possible on the hosting operating system."""
    import signal
    rposix.kill(os.getpid(), signal.SIGABRT)
Esempio n. 6
0
def kill(space, pid, sig):
    "Kill a process with a signal."
    try:
        rposix.kill(pid, sig)
    except OSError as e:
        raise wrap_oserror(space, e)