| 136 | |
| 137 | |
| 138 | PyObject * |
| 139 | PP_Debug_Function(PyObject *func, PyObject *args) |
| 140 | { |
| 141 | int oops = 0, res = 0; |
| 142 | PyObject *presult = NULL; |
| 143 | |
| 144 | /* expand tuple at front */ |
| 145 | // it seems that some versions of python want just 2 arguments; in that |
| 146 | // case, remove trailing 1 |
| 147 | oops = _PyTuple_Resize(&args, (1 + PyTuple_Size(args))); |
| 148 | oops |= PyTuple_SetItem(args, 0, func); |
| 149 | if (oops) |
| 150 | return NULL; /* "args = (funcobj,) + (arg,..)" */ |
| 151 | |
| 152 | res = PP_Run_Function( /* "pdb.runcall(funcobj, arg,..)" */ |
| 153 | "pdb", "runcall", /* recursive run_function */ |
| 154 | "O", &presult, |
| 155 | "O", args); /* args already is a tuple */ |
| 156 | return (res != 0) ? NULL : presult; /* errors in run_function? */ |
| 157 | } /* presult not yet decref'd */ |
| 158 | |
| 159 | |
| 160 | int |
no test coverage detected