Skip to content

Commit

Permalink
fixed type error
Browse files Browse the repository at this point in the history
  • Loading branch information
SZonkil committed Mar 14, 2024
1 parent dc2b1aa commit 7b0fc72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sio/executors/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -151,4 +153,6 @@ def output_to_fraction(output_str):
% output_str
)
except ZeroDivisionError:
raise CheckerError('Zero division in checker output "%s"' % output_str)
raise CheckerError('Zero division in checker output "%s"' % output_str)
except TypeError:
raise CheckerError('Invalid checker output "%s"' % output_str)

0 comments on commit 7b0fc72

Please sign in to comment.