diff problem.py @ 94:b7fb64ce03d9

Fixed a couple of bugs
author Oleg Oshmyan <chortos@inbox.lv>
date Mon, 28 Feb 2011 21:35:25 +0000
parents c62c9bfd614a
children 523ba6907f3a
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: