Skip to content

Commit

Permalink
fix: bug initializing sync_playwright when using uvloop.EventPolicy. (
Browse files Browse the repository at this point in the history
#2311)

Co-authored-by: danphenderson <[email protected]>
  • Loading branch information
danphenderson and danphenderson authored Feb 26, 2024
1 parent 976f04f commit a4d5fcc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions playwright/_impl/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,20 +334,22 @@ def _send_message_to_server(
"line": frames[0]["line"],
"column": frames[0]["column"],
}
if len(frames) > 0
if frames
else None
)
metadata = {
"wallTime": int(datetime.datetime.now().timestamp() * 1000),
"apiName": stack_trace_information["apiName"],
"internal": not stack_trace_information["apiName"],
}
if location:
metadata["location"] = location # type: ignore
message = {
"id": id,
"guid": object._guid,
"method": method,
"params": self._replace_channels_with_guids(params),
"metadata": {
"wallTime": int(datetime.datetime.now().timestamp() * 1000),
"apiName": stack_trace_information["apiName"],
"location": location,
"internal": not stack_trace_information["apiName"],
},
"metadata": metadata,
}
if self._tracing_count > 0 and frames and object._guid != "localUtils":
self.local_utils.add_stack_to_tracing_no_reply(id, frames)
Expand Down

0 comments on commit a4d5fcc

Please sign in to comment.