eric6/DebugClients/Python/DebugBase.py

branch
multi_processing
changeset 7405
bf6be3cff6cf
parent 7397
f8d2f6dd6636
child 7421
4a9900aef04e
equal deleted inserted replaced
7404:663f1c3d6f53 7405:bf6be3cff6cf
12 import types 12 import types
13 import atexit 13 import atexit
14 import inspect 14 import inspect
15 import ctypes 15 import ctypes
16 import time 16 import time
17 from inspect import CO_GENERATOR
18 17
19 from BreakpointWatch import Breakpoint, Watch 18 from BreakpointWatch import Breakpoint, Watch
20 19
21 if sys.version_info[0] == 2: 20 if sys.version_info[0] == 2:
22 import thread as _thread 21 import thread as _thread
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':

eric ide

mercurial