Skip to content

Commit 7580830

Browse files
authored
fix: float value serialization (microsoft#277)
1 parent 0977f88 commit 7580830

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

playwright/js_handle.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,14 @@ def serialize_value(value: Any, handles: List[JSHandle], depth: int) -> Any:
111111
return dict(v="-Infinity")
112112
if value == float("-0"):
113113
return dict(v="-0")
114-
if value == float("-0"):
115-
return dict(v="-0")
116114
if math.isnan(value):
117115
return dict(v="NaN")
118116
if isinstance(value, datetime):
119117
return dict(d=value.isoformat() + "Z")
120118
if isinstance(value, bool):
121119
return {"b": value}
122-
if isinstance(value, int):
120+
if isinstance(value, (int, float)):
123121
return {"n": value}
124-
if isinstance(value, float):
125-
return {"f": value}
126122
if isinstance(value, str):
127123
return {"s": value}
128124

0 commit comments

Comments
 (0)