MCPcopy Index your code
hub / github.com/RustPython/RustPython / _set_lines

Method _set_lines

Lib/traceback.py:344–357  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

342 return 4
343
344 def _set_lines(self):
345 if (
346 self._lines is None
347 and self.lineno is not None
348 and self.end_lineno is not None
349 ):
350 lines = []
351 for lineno in range(self.lineno, self.end_lineno + 1):
352 # treat errors (empty string) and empty lines (newline) as the same
353 line = linecache.getline(self.filename, lineno).rstrip()
354 if not line and self._code is not None and self.filename.startswith("<"):
355 line = linecache._getline_from_code(self._code, lineno).rstrip()
356 lines.append(line)
357 self._lines = "\n".join(lines) + "\n"
358
359 @property
360 def _original_lines(self):

Callers 3

_original_linesMethod · 0.95
_dedented_linesMethod · 0.95
lineMethod · 0.95

Calls 5

rstripMethod · 0.45
getlineMethod · 0.45
startswithMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected