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