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
Gwenaël Samain
cython
Commits
9cefe905
Commit
9cefe905
authored
Mar 11, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of unraisable warnings in the refnanny.
parent
521185b4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
19 deletions
+31
-19
Cython/Runtime/refnanny.pyx
Cython/Runtime/refnanny.pyx
+31
-19
No files found.
Cython/Runtime/refnanny.pyx
View file @
9cefe905
...
...
@@ -91,13 +91,17 @@ cdef void GOTREF(PyObject* ctx, PyObject* p_obj, int lineno):
if
ctx
==
NULL
:
return
cdef
PyObject
*
type
=
NULL
,
*
value
=
NULL
,
*
tb
=
NULL
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
try
:
try
:
if
p_obj
is
NULL
:
(
<
object
>
ctx
).
regref
(
None
,
lineno
,
True
)
else
:
(
<
object
>
ctx
).
regref
(
<
object
>
p_obj
,
lineno
,
False
)
except
Exception
,
e
:
except
object
,
e
:
report_unraisable
(
e
)
except
:
# __Pyx_GetException may itself raise errors
pass
PyErr_Restore
(
type
,
value
,
tb
)
cdef
int
GIVEREF_and_report
(
PyObject
*
ctx
,
PyObject
*
p_obj
,
int
lineno
):
...
...
@@ -105,13 +109,17 @@ cdef int GIVEREF_and_report(PyObject* ctx, PyObject* p_obj, int lineno):
cdef
PyObject
*
type
=
NULL
,
*
value
=
NULL
,
*
tb
=
NULL
cdef
bint
decref_ok
=
False
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
try
:
try
:
if
p_obj
is
NULL
:
decref_ok
=
(
<
object
>
ctx
).
delref
(
None
,
lineno
,
True
)
else
:
decref_ok
=
(
<
object
>
ctx
).
delref
(
<
object
>
p_obj
,
lineno
,
False
)
except
Exception
,
e
:
except
object
,
e
:
report_unraisable
(
e
)
except
:
# __Pyx_GetException may itself raise errors
pass
PyErr_Restore
(
type
,
value
,
tb
)
return
decref_ok
...
...
@@ -131,6 +139,7 @@ cdef void FinishContext(PyObject** ctx):
cdef
PyObject
*
type
=
NULL
,
*
value
=
NULL
,
*
tb
=
NULL
cdef
object
errors
=
None
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
try
:
try
:
errors
=
(
<
object
>
ctx
[
0
]).
end
()
pos
=
(
<
object
>
ctx
[
0
]).
filename
,
(
<
object
>
ctx
[
0
]).
name
...
...
@@ -139,6 +148,9 @@ cdef void FinishContext(PyObject** ctx):
print
errors
except
Exception
,
e
:
report_unraisable
(
e
)
except
:
# __Pyx_GetException may itself raise errors
pass
Py_DECREF
(
<
object
>
ctx
[
0
])
ctx
[
0
]
=
NULL
PyErr_Restore
(
type
,
value
,
tb
)
...
...
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