-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
This code:
if __name__ == '__main__':
time = str(input("Hoe laat is het? "))
if meal(time) == 'ontbijt':
x = 'ontbijt'
elif meal(time) == 'lunch':
x = 'lunch'
elif meal(time) == 'avondeten':
x = 'avondeten'
elif meal(time) == None:
quit(1)
print(f"het is tijd voor {x}")
yields ExitError -> exit(1) while trying to import the code as a check result.
I think this is expected behaviour from CheckPy.
The phrase while trying to import the code is somewhat misleading for students; it is clearly running the code as main or it would not have reached the quit() call. Would be good if the error correctly reports this context.
Now, when doing quit() without an exit code, which was actually what this student submitted, the CheckPy code crashes internally:
File "checkpy/lib/basic.py", line 205, in _getModuleAndOutputOf
message = "exit({}) while trying to import the code".format(int(e.args[0])),
~~~^^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
Would be nice if it handles quit() without an exit code, too.
Metadata
Metadata
Assignees
Labels
No labels