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

Method _set_lines

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

Source from the content-addressed store, hash-verified

358 return 4
359
360 def _set_lines(self):
361 if (
362 self._lines is None
363 and self.lineno is not None
364 and self.end_lineno is not None
365 ):
366 lines = []
367 for lineno in range(self.lineno, self.end_lineno + 1):
368 # treat errors (empty string) and empty lines (newline) as the same
369 line = linecache.getline(self.filename, lineno).rstrip()
370 if not line and self._code is not None and self.filename.startswith("<"):
371 line = linecache._getline_from_code(self._code, lineno).rstrip()
372 lines.append(line)
373 self._lines = "\n".join(lines) + "\n"
374
375 @property
376 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