MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / from_list

Method from_list

tools/python-3.11.9-amd64/Lib/traceback.py:437–453  ·  view source on GitHub ↗

Create a StackSummary object from a supplied list of FrameSummary objects or old-style list of tuples.

(klass, a_list)

Source from the content-addressed store, hash-verified

435
436 @classmethod
437 def from_list(klass, a_list):
438 """
439 Create a StackSummary object from a supplied list of
440 FrameSummary objects or old-style list of tuples.
441 """
442 # While doing a fast-path check for isinstance(a_list, StackSummary) is
443 # appealing, idlelib.run.cleanup_traceback and other similar code may
444 # break this by making arbitrary frames plain tuples, so we need to
445 # check on a frame by frame basis.
446 result = StackSummary()
447 for frame in a_list:
448 if isinstance(frame, FrameSummary):
449 result.append(frame)
450 else:
451 filename, lineno, name, line = frame
452 result.append(FrameSummary(filename, lineno, name, line=line))
453 return result
454
455 def format_frame_summary(self, frame_summary):
456 """Format the lines for a single FrameSummary.

Callers 2

print_listFunction · 0.80
format_listFunction · 0.80

Calls 3

StackSummaryClass · 0.85
FrameSummaryClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected