From 28385b16abb509c6a720b527430d68dc6b45a970 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Tue, 3 Feb 2009 14:00:31 -0200 Subject: [PATCH] remove those 'Refnanny' prefixes in refnanny.pyx --- Cython/Runtime/refnanny.pyx | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Cython/Runtime/refnanny.pyx b/Cython/Runtime/refnanny.pyx index 4b459e78..f3418bc8 100644 --- a/Cython/Runtime/refnanny.pyx +++ b/Cython/Runtime/refnanny.pyx @@ -11,10 +11,10 @@ cdef log(level, action, obj, lineno): LOG_NONE, LOG_ALL = range(2) -class RefnannyException(Exception): +class Error(Exception): pass -class RefnannyContext(object): +class Context(object): def __init__(self): self.refs = {} # id -> (count, [lineno]) self.errors = [] @@ -52,17 +52,17 @@ class RefnannyContext(object): self.errors.append("References leaked: %s" % msg) if self.errors: # print self.errors - raise RefnannyException("\n".join(self.errors)) + raise Error("\n".join(self.errors)) -cdef void* Refnanny_NewContext(char* funcname, int lineno) except NULL: +cdef void* NewContext(char* funcname, int lineno) except NULL: if exc.PyErr_Occurred() != NULL: print "error flag set on newcontext?" return NULL - ctx = RefnannyContext() + ctx = Context() Py_INCREF(ctx) return ctx -cdef void Refnanny_GOTREF(void* ctx, void* p_obj, int lineno): +cdef void GOTREF(void* ctx, void* p_obj, int lineno): cdef exc.PyObject* type = NULL, *value = NULL, *tb = NULL if ctx == NULL: return exc.PyErr_Fetch(&type, &value, &tb) @@ -78,7 +78,7 @@ cdef void Refnanny_GOTREF(void* ctx, void* p_obj, int lineno): Py_XDECREF(tb) raise -cdef void Refnanny_GIVEREF(void* ctx, void* p_obj, int lineno): +cdef void GIVEREF(void* ctx, void* p_obj, int lineno): cdef exc.PyObject* type = NULL, *value = NULL, *tb = NULL if ctx == NULL: return exc.PyErr_Fetch(&type, &value, &tb) @@ -94,16 +94,16 @@ cdef void Refnanny_GIVEREF(void* ctx, void* p_obj, int lineno): Py_XDECREF(tb) raise -cdef void Refnanny_INCREF(void* ctx, void* obj, int lineno): +cdef void INCREF(void* ctx, void* obj, int lineno): if obj is not NULL: Py_INCREF(obj) - Refnanny_GOTREF(ctx, obj, lineno) + GOTREF(ctx, obj, lineno) -cdef void Refnanny_DECREF(void* ctx, void* obj, int lineno): +cdef void DECREF(void* ctx, void* obj, int lineno): # GIVEREF raises exception if we hit 0 - Refnanny_GIVEREF(ctx, obj, lineno) + GIVEREF(ctx, obj, lineno) if obj is not NULL: Py_DECREF(obj) -cdef int Refnanny_FinishContext(void* ctx) except -1: +cdef int FinishContext(void* ctx) except -1: cdef exc.PyObject* type = NULL, *value = NULL, *tb = NULL if ctx == NULL: assert False @@ -136,11 +136,11 @@ ctypedef struct RefnannyAPIStruct: int (*FinishContext)(void*) except -1 cdef RefnannyAPIStruct api -api.INCREF = Refnanny_INCREF -api.DECREF = Refnanny_DECREF -api.GOTREF = Refnanny_GOTREF -api.GIVEREF = Refnanny_GIVEREF -api.NewContext = Refnanny_NewContext -api.FinishContext = Refnanny_FinishContext +api.INCREF = INCREF +api.DECREF = DECREF +api.GOTREF = GOTREF +api.GIVEREF = GIVEREF +api.NewContext = NewContext +api.FinishContext = FinishContext RefnannyAPI = PyCObject_FromVoidPtr(&api, NULL) -- 2.26.2