Beispiel #1
0
static PyObject *
cframe_reduce(PyCFrameObject *cf)
{
    PyObject *res = NULL, *exec_name = NULL;
    PyObject *params = NULL;
    int valid = 1;
    
    if ((exec_name = slp_find_execname((PyFrameObject *) cf, &valid)) == NULL)
	    return NULL;

    params = slp_into_tuple_with_nulls(&cf->ob1, 3);
    if (params == NULL) goto err_exit;

    res = Py_BuildValue ("(O()(" cframetuplefmt "))",
			 cf->ob_type,
			 valid,
			 exec_name,
			 params,
			 cf->i,
			 cf->n);
    
err_exit:
    Py_XDECREF(exec_name);
    Py_XDECREF(params);
    return res;
}
Beispiel #2
0
static PyObject *
bomb_reduce(PyBombObject *bomb)
{
	PyObject *tup;

	tup = slp_into_tuple_with_nulls(&bomb->curexc_type, 3);
	if (tup != NULL)
		tup = Py_BuildValue("(O()O)", &PyBomb_Type, tup);
	return tup;
}