Skip to content

Commit

Permalink
use getrawcode from _pytest._code
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Oct 19, 2022
1 parent 349f4bf commit 965e942
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/_pytest/_py/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def endswith(self, arg):
return str(self.path).endswith(arg)

def _evaluate(self, kw):
from .._code.source import getrawcode

for name, value in kw.items():
invert = False
meth = None
Expand All @@ -124,7 +126,7 @@ def _evaluate(self, kw):
if meth is None:
raise TypeError(f"no {name!r} checker available for {self.path!r}")
try:
if py.code.getrawcode(meth).co_argcount > 1:
if getrawcode(meth).co_argcount > 1:
if (not meth(value)) ^ invert:
return False
else:
Expand Down

0 comments on commit 965e942

Please sign in to comment.