Skip to content

Commit e973932

Browse files
committed
Also use inspect.stack(0) for the sync version of _connect
1 parent 5a92f4f commit e973932

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

playwright/_impl/_connection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,9 @@ def wrap_api_call_sync(
533533
if self._api_zone.get():
534534
return cb()
535535
task = asyncio.current_task(self._loop)
536-
st: List[inspect.FrameInfo] = getattr(task, "__pw_stack__", inspect.stack())
536+
st: List[inspect.FrameInfo] = getattr(
537+
task, "__pw_stack__", None
538+
) or inspect.stack(0)
537539
parsed_st = _extract_stack_trace_information_from_stack(st, is_internal)
538540
self._api_zone.set(parsed_st)
539541
try:

0 commit comments

Comments
 (0)