| 563 | |
| 564 | |
| 565 | int |
| 566 | PP_Run_Bytecode(PyObject *codeobj, /* run compiled bytecode object */ |
| 567 | const char *modname, /* in named module's namespace */ |
| 568 | const char *resfmt, void *restarget) |
| 569 | { |
| 570 | PyObject *presult = NULL, *module = NULL, *dict = NULL; |
| 571 | |
| 572 | if (! PyCode_Check(codeobj)) /* make sure it's bytecode */ |
| 573 | return -1; |
| 574 | module = PP_Load_Module(modname); /* get module, init python */ |
| 575 | if (module == NULL) /* not incref'd */ |
| 576 | return -1; |
| 577 | dict = PyModule_GetDict(module); /* get dict namespace */ |
| 578 | if (dict == NULL) /* not incref'd */ |
| 579 | return -1; |
| 580 | if (PP_DEBUG) |
| 581 | presult = PP_Debug_Bytecode(codeobj, dict); /* run in pdb */ |
| 582 | else |
| 583 | presult = PyEval_EvalCode((PyObject*)codeobj, dict, dict); |
| 584 | return PP_Convert_Result(presult, resfmt, restarget); /* expr val to C */ |
| 585 | } |
| 586 | |
| 587 | |
| 588 | /************************************************************************** |
nothing calls this directly
no test coverage detected