summaryrefslogtreecommitdiff
path: root/yaksh/hook_evaluator.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/hook_evaluator.py')
-rw-r--r--yaksh/hook_evaluator.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/yaksh/hook_evaluator.py b/yaksh/hook_evaluator.py
index 0819ec9..f5364d6 100644
--- a/yaksh/hook_evaluator.py
+++ b/yaksh/hook_evaluator.py
@@ -2,6 +2,8 @@
import sys
import traceback
import os
+import signal
+import psutil
# Local imports
from .file_utils import copy_files, delete_files
@@ -65,10 +67,12 @@ class HookEvaluator(BaseEvaluator):
check = hook_scope["check_answer"]
success, err, mark_fraction = check(self.user_answer)
except TimeoutException:
+ processes = psutil.Process(os.getpid()).children(recursive=True)
+ for process in processes:
+ process.kill()
raise
except Exception:
msg = traceback.format_exc(limit=0)
err = "Error in Hook code: {0}".format(msg)
del tb
return success, err, mark_fraction
- \ No newline at end of file