Skip to content

Commit

Permalink
Merge pull request #188 from tonyandrewmeyer/fix-3.8-inspect-compat
Browse files Browse the repository at this point in the history
fix: adjust the inspect.signature behaviour to work with Python 3.8
  • Loading branch information
PietroPasotti authored Sep 9, 2024
2 parents 60010ea + 199581b commit 29a50b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "ops-scenario"

version = "7.0.0"
version = "7.0.1"

authors = [
{ name = "Pietro Pasotti", email = "[email protected]" }
Expand Down
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 29a50b7

Please sign in to comment.