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

Method uninamereplace

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

appendMethod · 0.45
nameMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected