Skip to content

Commit 2c45ce2

Browse files
arman-novikovrwgk
authored andcommitted
fix: readability-implicit-bool-conversion
1 parent 56dc4b4 commit 2c45ce2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/pybind11/embed.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,18 @@ inline void initialize_interpreter(PyConfig *config,
9999
const char *const *argv = nullptr,
100100
bool add_program_dir_to_path = true) {
101101
PyStatus status = PyConfig_SetBytesArgv(config, argc, const_cast<char *const *>(argv));
102-
if (PyStatus_Exception(status)) {
102+
if (PyStatus_Exception(status) != 0) {
103103
// A failure here indicates a character-encoding failure or the python
104104
// interpreter out of memory. Give up.
105105
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");
108108
}
109109
status = Py_InitializeFromConfig(config);
110-
if (PyStatus_Exception(status)) {
110+
if (PyStatus_Exception(status) != 0) {
111111
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");
114114
}
115115
if (add_program_dir_to_path) {
116116
PyRun_SimpleString("import sys, os.path; "

0 commit comments

Comments
 (0)