We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28c7074 commit 21bc2a2Copy full SHA for 21bc2a2
py/selenium/webdriver/common/bidi/bidi.py
@@ -25,8 +25,7 @@ class BidiObject:
25
def to_json(self):
26
json = {}
27
for field in fields(self):
28
- key = field.name[1:] if field.name.startswith("_") else field.name
29
- value = getattr(self, key)
+ value = getattr(self, field.name)
30
if value is None:
31
continue
32
if is_dataclass(value):
@@ -35,6 +34,7 @@ def to_json(self):
35
34
value = [v.to_json() if hasattr(v, "to_json") else v for v in value]
36
elif isinstance(value, dict):
37
value = {k: v.to_json() if hasattr(v, "to_json") else v for k, v in value.items()}
+ key = field.name[1:] if field.name.startswith("_") else field.name
38
json[key] = value
39
return json
40
0 commit comments