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

Method user_exception

Lib/pdb.py:304–321  ·  view source on GitHub ↗

This function is called if an exception occurs, but only if we are to stop at or just below this level.

(self, frame, exc_info)

Source from the content-addressed store, hash-verified

302 self.interaction(frame, None)
303
304 def user_exception(self, frame, exc_info):
305 """This function is called if an exception occurs,
306 but only if we are to stop at or just below this level."""
307 if self._wait_for_mainpyfile:
308 return
309 exc_type, exc_value, exc_traceback = exc_info
310 frame.f_locals['__exception__'] = exc_type, exc_value
311
312 # An 'Internal StopIteration' exception is an exception debug event
313 # issued by the interpreter when handling a subgenerator run with
314 # 'yield from' or a generator controlled by a for loop. No exception has
315 # actually occurred in this case. The debugger uses this debug event to
316 # stop when the debuggee is returning from such generators.
317 prefix = 'Internal ' if (not exc_traceback
318 and exc_type is StopIteration) else ''
319 self.message('%s%s' % (prefix,
320 traceback.format_exception_only(exc_type, exc_value)[-1].strip()))
321 self.interaction(frame, exc_traceback)
322
323 # General interaction function
324 def _cmdloop(self):

Callers

nothing calls this directly

Calls 4

messageMethod · 0.95
interactionMethod · 0.95
format_exception_onlyMethod · 0.80
stripMethod · 0.45

Tested by

no test coverage detected