MCPcopy Index your code
hub / github.com/ipython/ipython / syntax_error_transformer

Function syntax_error_transformer

tests/test_interactivshell.py:239–248  ·  view source on GitHub ↗

Transformer that throws SyntaxError if 'syntaxerror' is in the code.

(lines)

Source from the content-addressed store, hash-verified

237
238
239def syntax_error_transformer(lines):
240 """Transformer that throws SyntaxError if 'syntaxerror' is in the code."""
241 for line in lines:
242 pos = line.find("syntaxerror")
243 if pos >= 0:
244 e = SyntaxError('input contains "syntaxerror"')
245 e.text = line
246 e.offset = pos + 1
247 raise e
248 return lines
249
250
251class TerminalMagicsTestCase(unittest.TestCase):

Callers

nothing calls this directly

Calls 1

findMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…