1. Robert Kern
  2. traceit

Commits

Robert Kern  committed dfb79e2

BUG: Better function locating.

  • Participants
  • Parent commits c2bdb2f
  • Branches default

Comments (0)

Files changed (1)

File _traceit.pyx

View file
 cdef int PYTRACE_PYTHON = PYTRACE_PY_FUNCTION | (1<<PyTrace_LINE) | (1<<PyTrace_EXCEPTION)
 cdef int PYTRACE_CALLS = (1<<PyTrace_CALL) | (1<<PyTrace_C_CALL)
 cdef int PYTRACE_RETURNS = (1<<PyTrace_RETURN) | (1<<PyTrace_C_RETURN)
-cdef int PYTRACE_HAS_FUNCTION = PYTRACE_PYTHON | (1<<PyTrace_C_EXCEPTION)
+cdef int PYTRACE_C = PYTRACE_C_FUNCTION | (1<<PyTrace_C_EXCEPTION)
 
 cdef dict filename_cache = {}
 cdef list ALL_EVENTS = ['call', 'exception', 'line', 'return', 'c_call', 'c_exception', 'c_return']
         else:
             self.arg = arg
 
-        if self.eventflag & PYTRACE_HAS_FUNCTION:
+        if self.eventflag & PYTRACE_PYTHON:
             self.function = frame.f_code.co_name
-        elif self.eventflag & PYTRACE_C_FUNCTION:
+        elif self.eventflag & PYTRACE_C:
             prefix = ''
             if hasattr(arg, '__self__'):
                 typename = type(arg.__self__).__name__