Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 'raise_input_error' inline with the bugfix in python/cpython#102978
Browse files Browse the repository at this point in the history
jscarfo11 committed Jan 13, 2025

Unverified

This user has not yet uploaded their public signing key.
1 parent 2da0135 commit c11feab
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/generic_grader/utils/importer.py
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ class InputError(Exception):
"""Custom Exception type."""

@classmethod
def raise_input_error(cls):
def raise_input_error(cls, *args, **kwargs):
"""Raise our custom exception."""
raise cls.InputError()

8 changes: 8 additions & 0 deletions tests/utils/test_importer.py
Original file line number Diff line number Diff line change
@@ -68,6 +68,14 @@ def test_ignores_function_input(fix_syspath):
"message": "Stuck at call to `input()` while importing `fake_func`",
"object": "fake_func",
},
{
# Tests the except block on line 51
"module": "fake_module",
"error": Importer.InputError,
"text": "input('foo', bar='spam')\nfake_func = lambda: None",
"message": "Stuck at call to `input()` while importing `fake_func`",
"object": "fake_func",
},
{
# Tests the except block on line 65
"module": "fake_module",

0 comments on commit c11feab

Please sign in to comment.