File tree 1 file changed +6
-6
lines changed 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -99,18 +99,18 @@ inline void initialize_interpreter(PyConfig *config,
99
99
const char *const *argv = nullptr ,
100
100
bool add_program_dir_to_path = true ) {
101
101
PyStatus status = PyConfig_SetBytesArgv (config, argc, const_cast <char *const *>(argv));
102
- if (PyStatus_Exception (status)) {
102
+ if (PyStatus_Exception (status) != 0 ) {
103
103
// A failure here indicates a character-encoding failure or the python
104
104
// interpreter out of memory. Give up.
105
105
PyConfig_Clear (config);
106
- throw std::runtime_error (PyStatus_IsError (status) ? status.err_msg
107
- : " Failed to prepare CPython" );
106
+ throw std::runtime_error (PyStatus_IsError (status) != 0 ? status.err_msg
107
+ : " Failed to prepare CPython" );
108
108
}
109
109
status = Py_InitializeFromConfig (config);
110
- if (PyStatus_Exception (status)) {
110
+ if (PyStatus_Exception (status) != 0 ) {
111
111
PyConfig_Clear (config);
112
- throw std::runtime_error (PyStatus_IsError (status) ? status.err_msg
113
- : " Failed to init CPython" );
112
+ throw std::runtime_error (PyStatus_IsError (status) != 0 ? status.err_msg
113
+ : " Failed to init CPython" );
114
114
}
115
115
if (add_program_dir_to_path) {
116
116
PyRun_SimpleString (" import sys, os.path; "
You can’t perform that action at this time.
0 commit comments