projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
862249f
)
implement 'raise ... from None' in Py3.3
author
Stefan Behnel
<stefan_ml@behnel.de>
Tue, 12 Feb 2013 19:23:56 +0000
(20:23 +0100)
committer
Stefan Behnel
<stefan_ml@behnel.de>
Tue, 12 Feb 2013 19:23:56 +0000
(20:23 +0100)
--HG--
extra : rebase_source :
9ad9c4ea052a3eae0888f02a07ba4c40d62ddddf
Cython/Utility/Exceptions.c
patch
|
blob
|
history
diff --git
a/Cython/Utility/Exceptions.c
b/Cython/Utility/Exceptions.c
index
252aa10
..
2c11287
100644
(file)
--- a/
Cython/Utility/Exceptions.c
+++ b/
Cython/Utility/Exceptions.c
@@
-186,9
+186,13
@@
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
goto bad;
}
- if (cause
&& cause != Py_None
) {
+ if (cause) {
PyObject *fixed_cause;
- if (PyExceptionClass_Check(cause)) {
+ if (cause == Py_None) {
+ /* raise ... from None */
+ Py_DECREF(cause);
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
fixed_cause = PyObject_CallObject(cause, NULL);
if (fixed_cause == NULL)
goto bad;