Mercurial > ~astiob > upreckon > hgweb
changeset 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 |
files | upreckon/problem.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/upreckon/problem.py Fri Jun 29 03:32:49 2012 +0300 +++ b/upreckon/problem.py Sat Oct 20 21:03:44 2012 +0100 @@ -206,7 +206,10 @@ if comment: say('%g/%g, %s (' % (granted, case.points, verdict), end='') sys.stdout.flush() - sys.stdout.buffer.write(comment) + try: + sys.stdout.buffer.write(comment) + except AttributeError: + sys.stdout.write(comment) say(')') else: say('%g/%g, %s' % (granted, case.points, verdict))