From 7b0fc72c78e81cd03b1a009ab65d3719d698ba39 Mon Sep 17 00:00:00 2001 From: Zonkil Date: Thu, 14 Mar 2024 19:35:50 +0100 Subject: [PATCH] fixed type error --- sio/executors/checker.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sio/executors/checker.py b/sio/executors/checker.py index d2300c6..98512ef 100644 --- a/sio/executors/checker.py +++ b/sio/executors/checker.py @@ -142,6 +142,8 @@ def run(environ, use_sandboxes=True): def output_to_fraction(output_str): if not output_str: return 100, 1 + if isinstance(output_str, bytes): + output_str = output_str.decode('utf-8') try: frac = Fraction(output_str) return frac.numerator, frac.denominator @@ -151,4 +153,6 @@ def output_to_fraction(output_str): % output_str ) except ZeroDivisionError: - raise CheckerError('Zero division in checker output "%s"' % output_str) \ No newline at end of file + raise CheckerError('Zero division in checker output "%s"' % output_str) + except TypeError: + raise CheckerError('Invalid checker output "%s"' % output_str) \ No newline at end of file