Skip to content

Commit 7372a05

Browse files
committed
Fix linting
1 parent 101a28d commit 7372a05

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/pluggy/_hooks.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,11 @@ def varnames(func: object) -> Tuple[Tuple[str, ...], Tuple[str, ...]]:
244244
except Exception:
245245
return (), ()
246246

247-
try: # func MUST be a function or method here or we won't parse any args
248-
sig = inspect.signature(func.__func__ if inspect.ismethod(func) else func)
247+
try:
248+
# func MUST be a function or method here or we won't parse any args.
249+
sig = inspect.signature(
250+
func.__func__ if inspect.ismethod(func) else func # type:ignore[arg-type]
251+
)
249252
except TypeError:
250253
return (), ()
251254

testing/test_helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,13 @@ def function4(arg1, *args, **kwargs):
8787

8888

8989
def test_varnames_decorator() -> None:
90-
F = TypeVar('F', bound=Callable[..., Any])
90+
F = TypeVar("F", bound=Callable[..., Any])
9191

9292
def my_decorator(func: F) -> F:
9393
@wraps(func)
9494
def wrapper(*args, **kwargs):
9595
return func(*args, **kwargs)
96+
9697
return cast(F, wrapper)
9798

9899
@my_decorator

0 commit comments

Comments
 (0)