Skip to content

Commit

Permalink
Inspect __init__ explicitly, for 3.8 compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Sep 9, 2024
1 parent 60010ea commit 21836cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scenario/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,13 @@ def __new__(cls, *args, **kwargs):
# declared, which aligns with dataclasses. Simpler ways of
# getting the arguments (like __annotations__) do not have that
# guarantee, although in practice it is the case.
parameters = inspect.signature(cls).parameters
parameters = inspect.signature(cls.__init__).parameters
required_args = [
name
for name in tuple(parameters)
if parameters[name].default is inspect.Parameter.empty
and name not in kwargs
and name != "self"
]
n_posargs = len(args)
max_n_posargs = cls._max_positional_args
Expand Down

0 comments on commit 21836cd

Please sign in to comment.