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

Function _transform_msg

Lib/tokenize.py:571–579  ·  view source on GitHub ↗

Transform error messages from the C tokenizer into the Python tokenize The C tokenizer is more picky than the Python one, so we need to massage the error messages a bit for backwards compatibility.

(msg)

Source from the content-addressed store, hash-verified

569 raise
570
571def _transform_msg(msg):
572 """Transform error messages from the C tokenizer into the Python tokenize
573
574 The C tokenizer is more picky than the Python one, so we need to massage
575 the error messages a bit for backwards compatibility.
576 """
577 if "unterminated triple-quoted string literal" in msg:
578 return "EOF in multi-line string"
579 return msg
580
581def _generate_tokens_from_c_tokenizer(source, encoding=None, extra_tokens=False):
582 """Tokenize a source reading Python code as unicode strings using the internal C tokenizer"""

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…