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

Method extract_line

Tools/cases_generator/plexer.py:86–91  ·  view source on GitHub ↗
(self, lineno: int)

Source from the content-addressed store, hash-verified

84 f"Expected {end!r} but reached EOF", tkn)
85
86 def extract_line(self, lineno: int) -> str:
87 # Return source line `lineno` (1-based)
88 lines = self.src.splitlines()
89 if lineno > len(lines):
90 return ""
91 return lines[lineno - 1]
92
93 def make_syntax_error(self, message: str, tkn: Token | None = None) -> SyntaxError:
94 # Construct a SyntaxError instance from message and token

Callers 1

make_syntax_errorMethod · 0.95

Calls 1

splitlinesMethod · 0.45

Tested by

no test coverage detected