summaryrefslogtreecommitdiff
path: root/yaksh/base_evaluator.py
diff options
context:
space:
mode:
authoradityacp2017-04-27 18:37:19 +0530
committeradityacp2017-04-27 18:37:19 +0530
commit624e752684125aa525d9b3643cbd7c9b7ba61682 (patch)
tree726da35ba55acacfde255e31bdc2233600f75395 /yaksh/base_evaluator.py
parentb191455c7d9b0f6c3548da174a68c8ab8052abf0 (diff)
parent2694fd6dd4d37a1a6570792e234998feef21edca (diff)
downloadonline_test-624e752684125aa525d9b3643cbd7c9b7ba61682.tar.gz
online_test-624e752684125aa525d9b3643cbd7c9b7ba61682.tar.bz2
online_test-624e752684125aa525d9b3643cbd7c9b7ba61682.zip
Remove conflicts from views after rebase
Diffstat (limited to 'yaksh/base_evaluator.py')
-rw-r--r--yaksh/base_evaluator.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/yaksh/base_evaluator.py b/yaksh/base_evaluator.py
index 071008f..e702f68 100644
--- a/yaksh/base_evaluator.py
+++ b/yaksh/base_evaluator.py
@@ -7,6 +7,7 @@ from os.path import join, isfile
from os.path import isdir, dirname, abspath, join, isfile, exists
import subprocess
import stat
+import signal
# Local imports
@@ -30,11 +31,11 @@ class BaseEvaluator(object):
stdout and stderr.
"""
try:
- proc = subprocess.Popen(cmd_args, *args, **kw)
+ proc = subprocess.Popen(cmd_args,preexec_fn=os.setpgrp, *args, **kw)
stdout, stderr = proc.communicate()
except TimeoutException:
# Runaway code, so kill it.
- proc.kill()
+ os.killpg(os.getpgid(proc.pid), signal.SIGKILL)
# Re-raise exception.
raise
return proc, stdout.decode('utf-8'), stderr.decode('utf-8')