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
… (#133)
  • Loading branch information
jscarfo11 authored Jan 22, 2025
1 parent 2d44eff commit 956735b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "generic-grader"
version = "0.1.20"
version = "0.1.21"
authors = [
{ name = "John Cole", email = "[email protected]" },
{ name = "Jack Scarfo", email = "[email protected]" },
Expand Down
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 956735b

Please sign in to comment.