Mercurial > ~astiob > upreckon > hgweb
changeset 94:b7fb64ce03d9
Fixed a couple of bugs
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Mon, 28 Feb 2011 21:35:25 +0000 |
parents | bd3fc9017f91 |
children | 6c2997616bdf |
files | problem.py unix.py |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/problem.py Mon Feb 28 16:58:16 2011 +0000 +++ b/problem.py Mon Feb 28 21:35:25 2011 +0000 @@ -32,7 +32,7 @@ __all__ = 'Problem', 'TestContext', 'test_context_end', 'TestGroup' def strerror(e): - s = getattr(e, 'strerror') + s = getattr(e, 'strerror', e) if not s: s = str(e) return ' (%s%s)' % (s[0].lower(), s[1:]) if s else '' @@ -170,6 +170,8 @@ verdict = 'cannot read the input file%s' % strerror(sys.exc_info()[1].upstream) except testcases.CannotReadAnswerFile: verdict = 'cannot read the reference output file%s' % strerror(sys.exc_info()[1].upstream) + except testcases.ExceptionWrapper: + verdict = 'unspecified reason [this may be a bug in test.py]%s' % strerror(sys.exc_info()[1].upstream) except testcases.TestCaseNotPassed: verdict = 'unspecified reason [this may be a bug in test.py]%s' % strerror(sys.exc_info()[1]) #except Exception:
--- a/unix.py Mon Feb 28 16:58:16 2011 +0000 +++ b/unix.py Mon Feb 28 21:35:25 2011 +0000 @@ -59,7 +59,7 @@ try: case.process = Popen(*args, **kwargs) except OSError: - raise CannotStartTestee(sys.exc_info()[1]) + raise testcases.CannotStartTestee(sys.exc_info()[1]) case.time_started = clock() if not case.maxtime: while True: