Author: Ronan Lamy <[email protected]>
Branch: py3.5
Changeset: r92420:32f2c8e9403e
Date: 2017-09-19 20:27 +0100
http://bitbucket.org/pypy/pypy/changeset/32f2c8e9403e/
Log: A failing Cython-related test
diff --git a/pypy/module/cpyext/test/test_exception.py
b/pypy/module/cpyext/test/test_exception.py
--- a/pypy/module/cpyext/test/test_exception.py
+++ b/pypy/module/cpyext/test/test_exception.py
@@ -45,3 +45,22 @@
PyExc_IOError);
""")])
assert module.get_aliases() == (OSError, OSError)
+
+ def test_implicit_chaining(self):
+ module = self.import_extension('foo', [
+ ("raise_exc", "METH_NOARGS",
+ """
+ PyObject *ev, *et, *tb;
+ PyErr_SetString(PyExc_ValueError, "foo");
+
+ // simplified copy of __Pyx_GetException
+ PyErr_Fetch(&et, &ev, &tb);
+ PyErr_NormalizeException(&et, &ev, &tb);
+ if (tb) PyException_SetTraceback(ev, tb);
+ PyErr_SetExcInfo(et, ev, tb);
+
+ PyErr_SetString(PyExc_TypeError, "bar");
+ return NULL;
+ """)])
+ excinfo = raises(TypeError, module.raise_exc)
+ assert excinfo.value.__context__
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit