diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-12 11:30:27 -0400 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-12 11:30:27 -0400 |
| commit | 09bc409657606a37346d82ab1e4c44a165bd3541 (patch) | |
| tree | 72c569f69f37acafdc89fde4724bde7b373ef8f9 /run/executable | |
| parent | 384e322f974534c1c734db144633e3c3e002b1f8 (diff) | |
Improved error handling in run_exps.py.
Diffstat (limited to 'run/executable')
| -rw-r--r-- | run/executable/executable.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/run/executable/executable.py b/run/executable/executable.py index 02e35ae..263e305 100644 --- a/run/executable/executable.py +++ b/run/executable/executable.py | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | import sys | 1 | import sys |
| 2 | import subprocess | 2 | import subprocess |
| 3 | import signal | 3 | import signal |
| 4 | from common import is_executable | 4 | from common import get_executable |
| 5 | 5 | ||
| 6 | class Executable(object): | 6 | class Executable(object): |
| 7 | '''Parent object that represents an executable for use in task-sets.''' | 7 | '''Parent object that represents an executable for use in task-sets.''' |
| 8 | 8 | ||
| 9 | def __init__(self, exec_file, extra_args=None, stdout_file = None, stderr_file = None): | 9 | def __init__(self, exec_file, extra_args=None, stdout_file = None, stderr_file = None): |
| 10 | self.exec_file = exec_file | 10 | self.exec_file = get_executable(exec_file) |
| 11 | self.cwd = None | 11 | self.cwd = None |
| 12 | self.stdout_file = stdout_file | 12 | self.stdout_file = stdout_file |
| 13 | self.stderr_file = stderr_file | 13 | self.stderr_file = stderr_file |
| @@ -18,7 +18,7 @@ class Executable(object): | |||
| 18 | else: | 18 | else: |
| 19 | self.extra_args = [str(a) for a in list(extra_args)] # make a duplicate | 19 | self.extra_args = [str(a) for a in list(extra_args)] # make a duplicate |
| 20 | 20 | ||
| 21 | if not is_executable(self.exec_file): | 21 | if not self.exec_file: |
| 22 | raise Exception("Not executable ? : %s" % self.exec_file) | 22 | raise Exception("Not executable ? : %s" % self.exec_file) |
| 23 | 23 | ||
| 24 | def __del__(self): | 24 | def __del__(self): |
