summaryrefslogtreecommitdiff
path: root/code_server.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2011-11-26 00:16:24 +0530
committerPrabhu Ramachandran2011-11-26 00:16:24 +0530
commit672163bfb8e656e5250b8349aad14b2a550b57b5 (patch)
treeb3d8357c7d2964cfb67e437affaf3eb1bbf9a889 /code_server.py
parent9000f58786bc21b05e59ddbe96f8be607f13a00d (diff)
downloadonline_test-672163bfb8e656e5250b8349aad14b2a550b57b5.tar.gz
online_test-672163bfb8e656e5250b8349aad14b2a550b57b5.tar.bz2
online_test-672163bfb8e656e5250b8349aad14b2a550b57b5.zip
BUG: Fix bugs.
If the user_dir was deleted, the script would fail. We now create the user_dir if it isn't there. If the bash script is not properly created you get other uncaught errors which were not reported. This is fixed and tested.
Diffstat (limited to 'code_server.py')
-rwxr-xr-xcode_server.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/code_server.py b/code_server.py
index 4d1663d..1276c76 100755
--- a/code_server.py
+++ b/code_server.py
@@ -166,11 +166,14 @@ class CodeServer(object):
signal.alarm(SERVER_TIMEOUT)
# Do whatever testing needed.
+ success = False
try:
success, err = self.check_bash_script(ref_path, submit_path, test_case_path)
except TimeoutException:
- success = False
err = self.timeout_msg
+ except:
+ type, value = sys.exc_info()[:2]
+ err = "Error: {0}".format(repr(value))
finally:
# Set back any original signal handler.
signal.signal(signal.SIGALRM, old_handler)