Skip to content

Commit

Permalink
Handle invalid __getattribute__ functions (#1833)
Browse files Browse the repository at this point in the history
* Handle invalid `__getattribute__` functions

Addresses #1832

* Update src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command.py

Co-authored-by: Mike Fährmann <[email protected]>

---------

Co-authored-by: Mike Fährmann <[email protected]>
  • Loading branch information
rchiodo and mikf authored Feb 12, 2025
1 parent fb0b06c commit ed9f294
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ def __init__(self, cmd_id, seq, text, is_json=False):
as_dict["pydevd_cmd_id"] = cmd_id
as_dict["seq"] = seq
self.as_dict = as_dict
text = json.dumps(as_dict)
try:
text = json.dumps(as_dict)
except TypeError:
text = json.dumps(as_dict, default=str)

assert isinstance(text, str)

Expand Down

0 comments on commit ed9f294

Please sign in to comment.