changeset 110:6d6d2c82e776 2.00

Absent output files no longer crash Upreckon
author Oleg Oshmyan <chortos@inbox.lv>
date Fri, 08 Apr 2011 17:45:53 +0300
parents dcabc9eb2fde
children 5462291b66d5
files testcases.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/testcases.py	Fri Apr 08 17:56:54 2011 +0300
+++ b/testcases.py	Fri Apr 08 17:45:53 2011 +0300
@@ -328,7 +328,11 @@
 				raise NonZeroExitCode(case.process.returncode)
 			case.has_called_back = True
 			callback()
-			with open(case.problem.config.outname, 'rU') as output:
+			try:
+				output = open(case.problem.config.outname, 'rU')
+			except IOError:
+				raise CannotReadOutputFile(sys.exc_info()[1])
+			with output as output:
 				return case.validate(output)