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

Method load_stack

Lib/idlelib/debugger.py:439–463  ·  view source on GitHub ↗
(self, stack, index=None)

Source from the content-addressed store, hash-verified

437 self.stack = []
438
439 def load_stack(self, stack, index=None):
440 self.stack = stack
441 self.clear()
442 for i in range(len(stack)):
443 frame, lineno = stack[i]
444 try:
445 modname = frame.f_globals["__name__"]
446 except:
447 modname = "?"
448 code = frame.f_code
449 filename = code.co_filename
450 funcname = code.co_name
451 import linecache
452 sourceline = linecache.getline(filename, lineno)
453 sourceline = sourceline.strip()
454 if funcname in ("?", "", None):
455 item = "%s, line %d: %s" % (modname, lineno, sourceline)
456 else:
457 item = "%s.%s(), line %d: %s" % (modname, funcname,
458 lineno, sourceline)
459 if i == index:
460 item = "> " + item
461 self.append(item)
462 if index is not None:
463 self.select(index)
464
465 def popup_event(self, event):
466 "Override base method."

Callers 3

show_stackMethod · 0.95
interactionMethod · 0.80
setUpMethod · 0.80

Calls 5

clearMethod · 0.45
getlineMethod · 0.45
stripMethod · 0.45
appendMethod · 0.45
selectMethod · 0.45

Tested by 1

setUpMethod · 0.64