Exception, Exception("elephant"), 32)
self.assertRaises(TypeError, fi.throw,
Exception("elephant"), Exception("elephant"))
+ # https://github.com/python/cpython/issues/101326
+ self.assertRaises(ValueError, fi.throw, ValueError, None, None)
self.assertRaises(TypeError, fi.throw, list)
def test_future_del_collect(self):
val = args[1];
}
- if (tb != NULL && !PyTraceBack_Check(tb)) {
+ if (val == Py_None) {
+ val = NULL;
+ }
+ if (tb == Py_None ) {
+ tb = NULL;
+ } else if (tb != NULL && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError, "throw() third argument must be a traceback");
return NULL;
}