@@ -255,7 +255,7 @@ If you can't simply review all the sourcecode then runtime analysis is one way t
255255 elif event.depth < self .depth and event.kind == ' return' : # stop if function returned
256256 op = event.instruction
257257 op = op if isinstance (op, int ) else ord (op)
258- if op == RETURN_VALUE :
258+ if op in RETURN_OPCODES :
259259 self .output(" {BRIGHT} {fore(BLUE)}{} tracing {} on {}{RESET}\n " ,
260260 " >" * 46 , event.function, self .exc)
261261 for event in self .events:
@@ -285,7 +285,7 @@ The most basic implementation that only measures timings looks like this:
285285.. code-block :: python
286286
287287 from hunter.actions import Action
288- from hunter.actions import RETURN_VALUE
288+ from hunter.actions import RETURN_OPCODES
289289
290290 class ProfileAction (Action ):
291291 def __init__ (self ):
@@ -321,7 +321,7 @@ This means that we have to store the exception for a little while, and do the ch
321321.. code-block :: python
322322
323323 from hunter.actions import Action
324- from hunter.actions import RETURN_VALUE
324+ from hunter.actions import RETURN_OPCODES
325325
326326 class ProfileAction (Action ):
327327 def __init__ (self ):
@@ -342,7 +342,7 @@ This means that we have to store the exception for a little while, and do the ch
342342 self .timings[frame_id] = start_time, event.arg
343343 elif event.kind == ' return' :
344344 delta = current_time - start_time
345- if event.instruction == RETURN_VALUE :
345+ if event.instruction in RETURN_OPCODES :
346346 # exception was discarded
347347 print (f ' { event.function} returned: { event.arg} . Duration: { delta:.4f } s \n ' )
348348 else :
@@ -362,7 +362,7 @@ Behold, a `ProfileAction` that works in any mode:
362362.. code-block :: python
363363
364364 from hunter.actions import ColorStreamAction
365- from hunter.actions import RETURN_VALUE
365+ from hunter.actions import RETURN_OPCODES
366366
367367 class ProfileAction (ColorStreamAction ):
368368 # using ColorStreamAction brings this more in line with the other actions
@@ -405,7 +405,7 @@ Behold, a `ProfileAction` that works in any mode:
405405 self .timings[frame_id] = start_time, event.arg
406406 elif event.kind == ' return' :
407407 delta = current_time - start_time
408- if event.instruction == RETURN_VALUE :
408+ if event.instruction in RETURN_OPCODES :
409409 # exception was discarded
410410 self .output(
411411 ' {fore(BLUE)}{} returned: {}. Duration: {:.4f}s{RESET}\n ' ,
0 commit comments