Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
d01287ad
Commit
d01287ad
authored
Feb 21, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refnanny: Remove dead exception raising code
parent
4d5d3045
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
21 deletions
+7
-21
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+2
-7
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-3
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-4
Cython/Runtime/refnanny.pyx
Cython/Runtime/refnanny.pyx
+2
-7
No files found.
Cython/Compiler/Code.py
View file @
d01287ad
...
...
@@ -921,13 +921,8 @@ class CCodeWriter(object):
def
put_setup_refcount_context
(
self
,
name
):
self
.
putln
(
'__Pyx_SetupRefcountContext("%s");'
%
name
)
def
put_finish_refcount_context
(
self
,
pos
,
name
,
retval_cname
,
err_val
):
self
.
putln
(
'if (__Pyx_FinishRefcountContext() == -1) {'
)
self
.
putln
(
self
.
set_error_info
(
pos
))
self
.
putln
(
'__Pyx_AddTraceback("%s");'
%
name
)
if
err_val
is
not
None
:
self
.
putln
(
'%s = %s;'
%
(
retval_cname
,
err_val
))
self
.
putln
(
'}'
)
def
put_finish_refcount_context
(
self
):
self
.
putln
(
"__Pyx_FinishRefcountContext();"
)
class
PyrexCodeWriter
:
...
...
Cython/Compiler/ModuleNode.py
View file @
d01287ad
...
...
@@ -1651,8 +1651,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
putln
(
"%s = NULL;"
%
Naming
.
retval_cname
)
code
.
put_label
(
code
.
return_label
)
# Disabled because of confusion with refcount of global variables -- run ass2cglobal testcase to see
#code.put_finish_refcount_context(self.pos, env.qualified_name,
# Naming.retval_cname, "NULL")
#code.put_finish_refcount_context()
code
.
putln
(
"#if CYTHON_REFNANNY"
)
code
.
putln
(
"if (__pyx_refchk) {};"
)
code
.
putln
(
"#endif"
)
...
...
@@ -2339,7 +2338,7 @@ typedef struct {
void (*GOTREF)(void*, PyObject*, int);
void (*GIVEREF)(void*, PyObject*, int);
void* (*NewContext)(const char*, int, const char*);
int
(*FinishContext)(void**);
void
(*FinishContext)(void**);
} __Pyx_RefnannyAPIStruct;
static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
#define __Pyx_ImportRefcountAPI(name)
\
...
...
Cython/Compiler/Nodes.py
View file @
d01287ad
...
...
@@ -1195,10 +1195,7 @@ class FuncDefNode(StatNode, BlockNode):
if
self
.
return_type
.
is_pyobject
:
code
.
put_xgiveref
(
self
.
return_type
.
as_pyobject
(
Naming
.
retval_cname
))
code
.
put_finish_refcount_context
(
self
.
pos
,
self
.
entry
.
qualified_name
,
Naming
.
retval_cname
,
err_val
)
code
.
put_finish_refcount_context
()
if
acquire_gil
:
code
.
putln
(
"PyGILState_Release(_save);"
)
...
...
Cython/Runtime/refnanny.pyx
View file @
d01287ad
...
...
@@ -115,7 +115,7 @@ cdef void DECREF(PyObject* ctx, PyObject* obj, int lineno):
GIVEREF
(
ctx
,
obj
,
lineno
)
if
obj
is
not
NULL
:
Py_DECREF
(
<
object
>
obj
)
cdef
int
FinishContext
(
PyObject
**
ctx
)
except
-
1
:
cdef
void
FinishContext
(
PyObject
**
ctx
)
:
cdef
PyObject
*
type
=
NULL
,
*
value
=
NULL
,
*
tb
=
NULL
if
ctx
==
NULL
:
assert
False
if
ctx
[
0
]
==
NULL
:
assert
False
# XXX What to do here?
...
...
@@ -129,17 +129,12 @@ cdef int FinishContext(PyObject** ctx) except -1:
Py_XDECREF
(
<
object
>
type
)
Py_XDECREF
(
<
object
>
value
)
Py_XDECREF
(
<
object
>
tb
)
raise
finally
:
Py_XDECREF
(
<
object
>
ctx
[
0
])
ctx
[
0
]
=
NULL
if
errors
:
print
u"%s: %s()"
%
pos
print
errors
# raise Error(errors)
return
0
cdef
extern
from
"Python.h"
:
object
PyCObject_FromVoidPtr
(
void
*
,
void
(
*
)(
void
*
))
...
...
@@ -150,7 +145,7 @@ ctypedef struct RefnannyAPIStruct:
void
(
*
GOTREF
)(
PyObject
*
,
PyObject
*
,
int
)
void
(
*
GIVEREF
)(
PyObject
*
,
PyObject
*
,
int
)
PyObject
*
(
*
NewContext
)(
char
*
,
int
,
char
*
)
except
NULL
int
(
*
FinishContext
)(
PyObject
**
)
except
-
1
void
(
*
FinishContext
)(
PyObject
**
)
cdef
RefnannyAPIStruct
api
api
.
INCREF
=
INCREF
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment