comparison upreckon/problem.py @ 233:54cdc583ab77

Fixed crashing on validator output on Python 2 (regression in f94f9724c543)
author Oleg Oshmyan <chortos@inbox.lv>
date Sat, 20 Oct 2012 21:03:44 +0100
parents f94f9724c543
children 2798cbebd83a
comparison
equal deleted inserted replaced
232:f94f9724c543 233:54cdc583ab77
204 verdict = 'partly correct' 204 verdict = 'partly correct'
205 granted *= case.points 205 granted *= case.points
206 if comment: 206 if comment:
207 say('%g/%g, %s (' % (granted, case.points, verdict), end='') 207 say('%g/%g, %s (' % (granted, case.points, verdict), end='')
208 sys.stdout.flush() 208 sys.stdout.flush()
209 sys.stdout.buffer.write(comment) 209 try:
210 sys.stdout.buffer.write(comment)
211 except AttributeError:
212 sys.stdout.write(comment)
210 say(')') 213 say(')')
211 else: 214 else:
212 say('%g/%g, %s' % (granted, case.points, verdict)) 215 say('%g/%g, %s' % (granted, case.points, verdict))
213 contexts[-1].case_end() 216 contexts[-1].case_end()
214 contexts[-1].score(granted, case.points) 217 contexts[-1].score(granted, case.points)