8000 Merge pull request #120 from jhamrick/master · tkf/emacs-ipython-notebook@0cc4943 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0cc4943

Browse files
committed
Merge pull request #120 from jhamrick/master
Resolve tools/testein.py failure on OS X
2 parents 87e88bc + b7a4692 commit 0cc4943

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tools/testein.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ def command(self):
376376
def kill_subprocesses(pid, include=lambda x: True):
377377
from subprocess import Popen, PIPE
378378
import signal
379-
command = [
380-
'ps', '--ppid', str(pid), '--format', 'pid,cmd', '--no-headers']
379+
380+
command = ['ps', '-e', '-o', 'ppid,pid,command']
381381
proc = Popen(command, stdout=PIPE, stderr=PIPE)
382382
(stdout, stderr) = proc.communicate()
383383
if proc.returncode != 0:
@@ -386,10 +386,10 @@ def kill_subprocesses(pid, include=lambda x: True):
386386
'{2}'.format(command, proc.returncode, stderr))
387387

388388
for line in map(str.strip, stdout.splitlines()):
389-
(pid, cmd) = line.split(' ', 1)
390-
if include(cmd):
391-
print "Killing PID={0} COMMAND={1}".format(pid, cmd)
392-
os.kill(int(pid), signal.SIGINT)
389+
(cmd_ppid, cmd_pid, cmd) = line.split(None, 2)
390+
if cmd_ppid == str(pid) and include(cmd):
391+
print "Killing PID={0} COMMAND={1}".format(cmd_pid, cmd)
392+
os.kill(int(cmd_pid), signal.SIGINT)
393393

394394

395395
def construct_command(args):

0 commit comments

Comments
 (0)
0