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
Hide 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
...
@@ -92,12 +92,16 @@ cdef void GOTREF(PyObject* ctx, PyObject* p_obj, int lineno):
...
@@ -92,12 +92,16 @@ cdef void GOTREF(PyObject* ctx, PyObject* p_obj, int lineno):
cdef
PyObject
*
type
=
NULL
,
*
value
=
NULL
,
*
tb
=
NULL
cdef
PyObject
*
type
=
NULL
,
*
value
=
NULL
,
*
tb
=
NULL
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
try
:
try
:
if
p_obj
is
NULL
:
try
:
(
<
object
>
ctx
).
regref
(
None
,
lineno
,
True
)
if
p_obj
is
NULL
:
else
:
(
<
object
>
ctx
).
regref
(
None
,
lineno
,
True
)
(
<
object
>
ctx
).
regref
(
<
object
>
p_obj
,
lineno
,
False
)
else
:
except
Exception
,
e
:
(
<
object
>
ctx
).
regref
(
<
object
>
p_obj
,
lineno
,
False
)
report_unraisable
(
e
)
except
object
,
e
:
report_unraisable
(
e
)
except
:
# __Pyx_GetException may itself raise errors
pass
PyErr_Restore
(
type
,
value
,
tb
)
PyErr_Restore
(
type
,
value
,
tb
)
cdef
int
GIVEREF_and_report
(
PyObject
*
ctx
,
PyObject
*
p_obj
,
int
lineno
):
cdef
int
GIVEREF_and_report
(
PyObject
*
ctx
,
PyObject
*
p_obj
,
int
lineno
):
...
@@ -106,12 +110,16 @@ cdef int GIVEREF_and_report(PyObject* ctx, PyObject* p_obj, int lineno):
...
@@ -106,12 +110,16 @@ cdef int GIVEREF_and_report(PyObject* ctx, PyObject* p_obj, int lineno):
cdef
bint
decref_ok
=
False
cdef
bint
decref_ok
=
False
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
try
:
try
:
if
p_obj
is
NULL
:
try
:
decref_ok
=
(
<
object
>
ctx
).
delref
(
None
,
lineno
,
True
)
if
p_obj
is
NULL
:
else
:
decref_ok
=
(
<
object
>
ctx
).
delref
(
None
,
lineno
,
True
)
decref_ok
=
(
<
object
>
ctx
).
delref
(
<
object
>
p_obj
,
lineno
,
False
)
else
:
except
Exception
,
e
:
decref_ok
=
(
<
object
>
ctx
).
delref
(
<
object
>
p_obj
,
lineno
,
False
)
report_unraisable
(
e
)
except
object
,
e
:
report_unraisable
(
e
)
except
:
# __Pyx_GetException may itself raise errors
pass
PyErr_Restore
(
type
,
value
,
tb
)
PyErr_Restore
(
type
,
value
,
tb
)
return
decref_ok
return
decref_ok
...
@@ -132,13 +140,17 @@ cdef void FinishContext(PyObject** ctx):
...
@@ -132,13 +140,17 @@ cdef void FinishContext(PyObject** ctx):
cdef
object
errors
=
None
cdef
object
errors
=
None
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
PyErr_Fetch
(
&
type
,
&
value
,
&
tb
)
try
:
try
:
errors
=
(
<
object
>
ctx
[
0
]).
end
()
try
:
pos
=
(
<
object
>
ctx
[
0
]).
filename
,
(
<
object
>
ctx
[
0
]).
name
errors
=
(
<
object
>
ctx
[
0
]).
end
()
if
errors
:
pos
=
(
<
object
>
ctx
[
0
]).
filename
,
(
<
object
>
ctx
[
0
]).
name
print
u"%s: %s()"
%
pos
if
errors
:
print
errors
print
u"%s: %s()"
%
pos
except
Exception
,
e
:
print
errors
report_unraisable
(
e
)
except
Exception
,
e
:
report_unraisable
(
e
)
except
:
# __Pyx_GetException may itself raise errors
pass
Py_DECREF
(
<
object
>
ctx
[
0
])
Py_DECREF
(
<
object
>
ctx
[
0
])
ctx
[
0
]
=
NULL
ctx
[
0
]
=
NULL
PyErr_Restore
(
type
,
value
,
tb
)
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