Skip to content

Commit 1972a8a

Browse files
committed
fix: end instead of endif
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 96c7daa commit 1972a8a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

include/pybind11/pybind11.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,14 +1349,12 @@ class module_ : public object {
13491349
handle this_file = PyModule_GetFilenameObject(m_ptr);
13501350
if (this_file) {
13511351
result.attr("__file__") = this_file;
1352-
}
1353-
else if (PyErr_ExceptionMatches(PyExc_SystemError) != 0) {
1352+
} else if (PyErr_ExceptionMatches(PyExc_SystemError) != 0) {
13541353
PyErr_Clear();
1355-
}
1356-
else {
1354+
} else {
13571355
throw error_already_set();
13581356
}
1359-
#end
1357+
#endif
13601358
attr(name) = result;
13611359
return result;
13621360
}

tests/test_embed/test_interpreter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ TEST_CASE("Restart the interpreter") {
318318
// C++ modules can be reloaded.
319319
auto cpp_module = py::module_::import("widget_module");
320320
REQUIRE(cpp_module.attr("add")(1, 2).cast<int>() == 3);
321-
321+
322322
// Also verify submodules work
323323
REQUIRE(cpp_module.attr("sub").attr("add")(1, 41).cast<int>() == 42);
324324

0 commit comments

Comments
 (0)