MCPcopy
hub / github.com/mitmproxy/mitmproxy / str_fun

Function str_fun

test/helper_tools/memoryleak.py:18–28  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

16
17
18def str_fun(obj):
19 if isinstance(obj, dict):
20 if "__memory_locals__" in obj:
21 return "(-locals-)"
22 if "self" in obj and isinstance(obj["self"], refbrowser.InteractiveBrowser):
23 return "(-browser-)"
24 return (
25 str(id(obj))
26 + ": "
27 + str(obj)[:100].replace("\r\n", "\\r\\n").replace("\n", "\\n")
28 )
29
30
31def request(ctx, flow):

Callers

nothing calls this directly

Calls 2

idFunction · 0.50
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…