343 if not self.__skipFrame(frame): |
342 if not self.__skipFrame(frame): |
344 # When stepping with next/until/return in a generator frame, |
343 # When stepping with next/until/return in a generator frame, |
345 # skip the internal StopIteration exception (with no traceback) |
344 # skip the internal StopIteration exception (with no traceback) |
346 # triggered by a subiterator run with the 'yield from' |
345 # triggered by a subiterator run with the 'yield from' |
347 # statement. |
346 # statement. |
348 if not (frame.f_code.co_flags & CO_GENERATOR and |
347 if not (frame.f_code.co_flags & inspect.CO_GENERATOR and |
349 arg[0] is StopIteration and arg[2] is None): |
348 arg[0] is StopIteration and arg[2] is None): |
350 self.user_exception(arg) |
349 self.user_exception(arg) |
351 # Stop at the StopIteration or GeneratorExit exception when the |
350 # Stop at the StopIteration or GeneratorExit exception when the |
352 # user has set stopframe in a generator by issuing a return |
351 # user has set stopframe in a generator by issuing a return |
353 # command, or a next/until command at the last statement in the |
352 # command, or a next/until command at the last statement in the |
354 # generator before the exception. |
353 # generator before the exception. |
355 elif (self.stopframe and frame is not self.stopframe and |
354 elif (self.stopframe and frame is not self.stopframe and |
356 self.stopframe.f_code.co_flags & CO_GENERATOR and |
355 self.stopframe.f_code.co_flags & inspect.CO_GENERATOR and |
357 arg[0] in (StopIteration, GeneratorExit)): |
356 arg[0] in (StopIteration, GeneratorExit)): |
358 self.user_exception(arg) |
357 self.user_exception(arg) |
359 return None |
358 return None |
360 |
359 |
361 if event == 'c_call': |
360 if event == 'c_call': |