Skip to content

Commit

Permalink
Merge branch 'master' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Mar 22, 2023
2 parents d03add0 + a37c482 commit e40fd40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/typeguard/_checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,9 @@ def load_plugins() -> None:
continue

if not callable(plugin):
warnings.warn(f"Plugin {ep} returned a non-callable object: {plugin!r}")
warnings.warn(
f"Plugin {ep} returned a non-callable object: {plugin!r}", stacklevel=2
)
continue

checker_lookup_functions.insert(0, plugin)
2 changes: 1 addition & 1 deletion src/typeguard/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def is_method_of(obj: object, cls: type) -> bool:
def get_stacklevel() -> int:
level = 1
frame = cast(FrameType, currentframe()).f_back
while frame and frame.f_globals.get("__name__", "").startswith("typeguard"):
while frame and frame.f_globals.get("__name__", "").startswith("typeguard."):
level += 1
frame = frame.f_back

Expand Down

0 comments on commit e40fd40

Please sign in to comment.