Box* sysExcInfo() { ExcInfo* exc = getFrameExcInfo(); assert(exc->type); assert(exc->value); Box* tb = exc->traceback ? exc->traceback : None; return BoxedTuple::create({ exc->type, exc->value, tb }); }
Box* sysExcInfo() { ExcInfo* exc = getFrameExcInfo(); assert(exc->type); assert(exc->value); assert(exc->traceback); return BoxedTuple::create({ exc->type, exc->value, exc->traceback }); }
void raise0() { ExcInfo* exc_info = getFrameExcInfo(); assert(exc_info->type); // TODO need to clean up when we call normalize, do_raise, etc if (exc_info->type == None) raiseExcHelper(TypeError, "exceptions must be old-style classes or derived from BaseException, not NoneType"); raiseRaw(*exc_info); }
Box* sysExcClear() { ExcInfo* exc = getFrameExcInfo(); assert(exc->type); assert(exc->value); assert(exc->traceback); exc->type = None; exc->value = None; exc->traceback = None; return None; }
Box* sysExcClear() { ExcInfo* exc = getFrameExcInfo(); assert(exc->type); assert(exc->value); Box* old_type = exc->type; Box* old_value = exc->value; Box* old_traceback = exc->traceback; exc->type = incref(None); exc->value = incref(None); exc->traceback = NULL; Py_DECREF(old_type); Py_DECREF(old_value); Py_XDECREF(old_traceback); Py_RETURN_NONE; }