(exc)
| 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) |
nothing calls this directly
no test coverage detected