ionelmc / python-hunter

Hunter is a flexible code tracing toolkit.
https://python-hunter.readthedocs.io/
BSD 2-Clause "Simplified" License
800 stars 47 forks source link

Is the `local` arg to hunter.wrap obsolete? #44

Closed aminusfu closed 5 years ago

aminusfu commented 5 years ago

When I try to supply local=True to hunter.wrap as described in its docstring I get the traceback:

...my code stack...
  File "/home/fumanchu/envs/crunch/local/lib/python2.7/site-packages/hunter/__init__.py", line 231, in tracing_wrapper
    tracer = trace(~When(Q(calls_gt=0, depth=0), Stop), **trace_options)
  File "/home/fumanchu/envs/crunch/local/lib/python2.7/site-packages/hunter/__init__.py", line 189, in trace
    predicate = _prepare_predicate(*predicates, **options)
  File "/home/fumanchu/envs/crunch/local/lib/python2.7/site-packages/hunter/__init__.py", line 153, in _prepare_predicate
    return Q(*predicates, **options)
  File "/home/fumanchu/envs/crunch/local/lib/python2.7/site-packages/hunter/__init__.py", line 85, in Q
    predicates += Query(**query),
  File "src/hunter/_predicates.pyx", line 109, in hunter._predicates.Query.__init__
TypeError: Unexpected argument 'local'. Must be one of (u'function', u'code', u'frame', u'module', u'lineno', u'globals', u'stdlib', u'arg', u'locals', u'kind', u'filename', u'source', u'fullsource', u'threadname', u'threadid', u'depth', u'calls').

What am I missing?

ionelmc commented 5 years ago

Ooooof... looks like I forgot to implement it or something 😵

It was supposed to be the equivalent of adding depth_lte=1 or similar.