MCPcopy Index your code
hub / github.com/RustPython/RustPython / uninamereplace

Method uninamereplace

Lib/test/test_codeccallbacks.py:131–137  ·  view source on GitHub ↗
(exc)

Source from the content-addressed store, hash-verified

129 # unnecessary escape sequences.
130
131 def uninamereplace(exc):
132 if not isinstance(exc, UnicodeEncodeError):
133 raise TypeError("don't know how to handle %r" % exc)
134 l = []
135 for c in exc.object[exc.start:exc.end]:
136 l.append(unicodedata.name(c, "0x%x" % ord(c)))
137 return ("\033[1m%s\033[0m" % ", ".join(l), exc.end)
138
139 codecs.register_error(
140 "test.uninamereplace", uninamereplace)

Callers

nothing calls this directly

Calls 5

isinstanceFunction · 0.85
ordFunction · 0.85
appendMethod · 0.45
nameMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected