MCPcopy Index your code
hub / github.com/python/cpython / _safe_string

Function _safe_string

Lib/traceback.py:210–214  ·  view source on GitHub ↗
(value, what, func=str)

Source from the content-addressed store, hash-verified

208
209
210def _safe_string(value, what, func=str):
211 try:
212 return func(value)
213 except:
214 return f'<{what} {func.__name__}() failed>'
215
216# --
217

Callers 4

_format_final_exc_lineFunction · 0.85
__init__Method · 0.85
__init__Method · 0.85
format_exception_onlyMethod · 0.85

Calls 1

funcFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…