ionelmc / python-hunter

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

Check if positional arguments to hunter.trace() are actually callable #23

Closed ionelmc closed 8 years ago

ionelmc commented 8 years ago

Would avoid silly breakages like:

Traceback (most recent call last):
  File "src/hunter/_tracer.pyx", line 23, in hunter._tracer.trace_func (src/hunter/_tracer.c:1041)
  File "src/hunter/_predicates.pyx", line 251, in hunter._predicates.fast_When_call (src/hunter/_predicates.c:6802)
TypeError: 'str' object is not callable
Error in sys.exitfunc:
Traceback (most recent call last):
  File "src/hunter/_tracer.pyx", line 23, in hunter._tracer.trace_func (src/hunter/_tracer.c:1041)
  File "src/hunter/_predicates.pyx", line 251, in hunter._predicates.fast_When_call (src/hunter/_predicates.c:6802)
TypeError: 'str' object is not callable
Exception TypeError: "'str' object is not callable" in <function _remove at 0x7f064c7a19b0> ignored
Exception TypeError: "'str' object is not callable" in <function _remove at 0x7f064c6f78c0> ignored