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)
| 357 | self.interaction(frame, None) |
| 358 | |
| 359 | def user_exception(self, frame, exc_info): |
| 360 | """This function is called if an exception occurs, |
| 361 | but only if we are to stop at or just below this level.""" |
| 362 | if self._wait_for_mainpyfile: |
| 363 | return |
| 364 | exc_type, exc_value, exc_traceback = exc_info |
| 365 | frame.f_locals['__exception__'] = exc_type, exc_value |
| 366 | |
| 367 | # An 'Internal StopIteration' exception is an exception debug event |
| 368 | # issued by the interpreter when handling a subgenerator run with |
| 369 | # 'yield from' or a generator controlled by a for loop. No exception has |
| 370 | # actually occurred in this case. The debugger uses this debug event to |
| 371 | # stop when the debuggee is returning from such generators. |
| 372 | prefix = 'Internal ' if (not exc_traceback |
| 373 | and exc_type is StopIteration) else '' |
| 374 | self.message('%s%s' % (prefix, |
| 375 | traceback.format_exception_only(exc_type, exc_value)[-1].strip())) |
| 376 | self.interaction(frame, exc_traceback) |
| 377 | |
| 378 | # General interaction function |
| 379 | def _cmdloop(self): |
nothing calls this directly
no test coverage detected