| 574 | } |
| 575 | |
| 576 | int Python_run_command_with_log(const char *command) |
| 577 | { |
| 578 | PyObject *m, *d, *v; |
| 579 | m = PyImport_AddModule("__main__"); |
| 580 | if (m == NULL) |
| 581 | return -1; |
| 582 | d = PyModule_GetDict(m); |
| 583 | v = PyRun_String(command, file_input, d, d); |
| 584 | if (v == NULL) { |
| 585 | ExceptionHandler(EHA_DISPLAY_DIALOG); |
| 586 | return 1; // indicate failure, with traceback correctly shown. |
| 587 | } |
| 588 | DODECREF(v); |
| 589 | return 0; |
| 590 | } |
| 591 | |
| 592 | void Python_set_error(const char *msg) |
| 593 | { |
no test coverage detected