Skip to content

Commit

Permalink
use getattr instead of cast to get the class __init__ for legacy ctors
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Jun 7, 2021
1 parent a6f864a commit 7db9fa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_pytest/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _create(self, *k, **kw):
try:
return super().__call__(*k, **kw)
except TypeError:
sig = signature(cast(Type[Node], self).__init__)
sig = signature(getattr(self, "__init__"))
known_kw = {k: v for k, v in kw.items() if k in sig.parameters}
from .warning_types import PytestDeprecationWarning

Expand Down

0 comments on commit 7db9fa0

Please sign in to comment.