summaryrefslogtreecommitdiff
path: root/yaksh/base_evaluator.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2018-06-07 16:14:37 +0530
committerGitHub2018-06-07 16:14:37 +0530
commit4eb754c2e71922819de7390d1b4993a21763de3e (patch)
treefede3f4250f3711d31da4bb7edd262edd0a90727 /yaksh/base_evaluator.py
parent78ce1804d3a82327aa0da1510bb5c03d6bbff3ba (diff)
parent93bb10eae5e1364ae6492f2534f0e7864c9c4254 (diff)
downloadonline_test-4eb754c2e71922819de7390d1b4993a21763de3e.tar.gz
online_test-4eb754c2e71922819de7390d1b4993a21763de3e.tar.bz2
online_test-4eb754c2e71922819de7390d1b4993a21763de3e.zip
Merge pull request #482 from adityacp/pep8_changes
Pep8 changes
Diffstat (limited to 'yaksh/base_evaluator.py')
-rw-r--r--yaksh/base_evaluator.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/yaksh/base_evaluator.py b/yaksh/base_evaluator.py
index e702f68..567d5ad 100644
--- a/yaksh/base_evaluator.py
+++ b/yaksh/base_evaluator.py
@@ -1,20 +1,19 @@
#!/usr/bin/env python
from __future__ import unicode_literals
-import traceback
-import pwd
import os
-from os.path import join, isfile
-from os.path import isdir, dirname, abspath, join, isfile, exists
+from os.path import abspath, exists
import subprocess
import stat
import signal
# Local imports
-from .grader import MY_DIR, TimeoutException
+from .grader import TimeoutException
+
class BaseEvaluator(object):
- """Base Evaluator class containing generic attributes and callable methods"""
+ """Base Evaluator class containing generic attributes
+ and callable methods"""
def __init__(self):
pass
@@ -31,7 +30,8 @@ class BaseEvaluator(object):
stdout and stderr.
"""
try:
- proc = subprocess.Popen(cmd_args,preexec_fn=os.setpgrp, *args, **kw)
+ proc = subprocess.Popen(cmd_args,
+ preexec_fn=os.setpgrp, *args, **kw)
stdout, stderr = proc.communicate()
except TimeoutException:
# Runaway code, so kill it.
@@ -64,6 +64,6 @@ class BaseEvaluator(object):
submit_f.close()
def _set_file_as_executable(self, fname):
- os.chmod(fname, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
- | stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP
- | stat.S_IROTH | stat.S_IWOTH | stat.S_IXOTH)
+ os.chmod(fname, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
+ stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP | stat.S_IROTH |
+ stat.S_IWOTH | stat.S_IXOTH)