File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -157,12 +157,14 @@ inline void initialize_interpreter(bool init_signal_handlers = true,
157157 // A failure here indicates a character-encoding failure or the python
158158 // interpreter out of memory. Give up.
159159 PyConfig_Clear (&config);
160- throw std::runtime_error (" Failed to prepare CPython" );
160+ throw std::runtime_error (PyStatus_IsError (status) ? status.err_msg
161+ : " Failed to prepare CPython" );
161162 }
162163 status = Py_InitializeFromConfig (&config);
163164 PyConfig_Clear (&config);
164165 if (PyStatus_Exception (status)) {
165- throw std::runtime_error (" Failed to init CPython" );
166+ throw std::runtime_error (PyStatus_IsError (status) ? status.err_msg
167+ : " Failed to init CPython" );
166168 }
167169 if (add_program_dir_to_path) {
168170 PyRun_SimpleString (" import sys, os.path; "
You can’t perform that action at this time.
0 commit comments