Skip to content

Commit

Permalink
Fix 'raise_input_error' inline with the bugfix in python/cpython#102978
Browse files Browse the repository at this point in the history
  • Loading branch information
jscarfo11 committed Jan 13, 2025
1 parent 2da0135 commit c11feab
Show file tree
Hide file tree
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
Expand Up @@ -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()

Expand Down
8 changes: 8 additions & 0 deletions tests/utils/test_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c11feab

Please sign in to comment.