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
Boxiang Sun
cython
Commits
c2995742
Commit
c2995742
authored
Jan 27, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refnanny fix...
parent
7cd4277a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
Cython/Runtime/build.sh
Cython/Runtime/build.sh
+1
-1
Cython/Runtime/refnanny.pyx
Cython/Runtime/refnanny.pyx
+9
-8
No files found.
Cython/Runtime/build.sh
View file @
c2995742
...
...
@@ -5,6 +5,6 @@
PYTHONINC
=
/usr/include/python2.5
python ../../cython.py refnanny.pyx
gcc
-shared
-pthread
-fPIC
-fwrapv
-
O2
-Wall
\
gcc
-shared
-pthread
-fPIC
-fwrapv
-
g
-Wall
\
-fno-strict-aliasing
-I
$PYTHONINC
\
-o
refnanny.so
-I
.
refnanny.c
Cython/Runtime/refnanny.pyx
View file @
c2995742
from
python_ref
cimport
Py_INCREF
,
Py_DECREF
from
python_ref
cimport
Py_INCREF
,
Py_DECREF
,
Py_XDECREF
cimport
python_exc
as
exc
...
...
@@ -45,7 +45,8 @@ class RefnannyContext(object):
msg
+=
"
\
n
Acquired on lines: "
+
", "
.
join
([
"%d"
%
x
for
x
in
linenos
])
self
.
errors
.
append
(
"References leaked: %s"
%
msg
)
if
self
.
errors
:
raise
RefnannyException
(
"
\
n
"
.
join
(
self
.
errors
))
print
self
.
errors
# raise RefnannyException("\n".join(self.errors))
cdef
public
void
*
__Pyx_Refnanny_NewContext
(
char
*
funcname
,
int
lineno
)
except
NULL
:
ctx
=
RefnannyContext
()
...
...
@@ -71,12 +72,12 @@ cdef public void __Pyx_Refnanny_DECREF(void* ctx, object obj, int lineno):
Py_DECREF
(
obj
)
cdef
public
int
__Pyx_Refnanny_FinishContext
(
void
*
ctx
)
except
-
1
:
cdef
exc
.
PyObject
*
type
,
*
value
,
*
tb
if
exc
.
PyErr_Occurred
():
exc
.
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
Py_DECREF
(
<
object
>
type
);
Py_DECREF
(
<
object
>
value
);
Py_
DECREF
(
<
object
>
tb
)
print
"cleared!"
print
(
exc
.
PyErr_Occurred
()
==
NULL
)
#
cdef exc.PyObject* type, *value, *tb
##
if exc.PyErr_Occurred():
##
exc.PyErr_Fetch(&type, &value, &tb)
## Py_XDECREF(<object>type); Py_XDECREF(<object>value); Py_X
DECREF(<object>tb)
##
print "cleared!"
##
print (exc.PyErr_Occurred() == NULL)
obj
=
<
object
>
ctx
try
:
obj
.
end
()
...
...
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