Skip to content

Commit eb0a55b

Browse files
committed
Resolving merge conflict in tests/test_pytypes.cpp when rebasing after the just-merged PR #3080. Also rerunning clang-format-diff.py to pick up a few fixes missed before.
1 parent 7945c34 commit eb0a55b

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

include/pybind11/detail/common.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,15 @@ extern "C" {
272272
} \
273273
}
274274

275-
#define PYBIND11_CATCH_INIT_EXCEPTIONS \
276-
catch (pybind11::error_already_set &e) { \
277-
PyErr_SetString(PyExc_ImportError, e.what()); \
278-
return nullptr; \
279-
} catch (const std::exception &e) { \
280-
PyErr_SetString(PyExc_ImportError, e.what()); \
281-
return nullptr; \
282-
} \
275+
#define PYBIND11_CATCH_INIT_EXCEPTIONS \
276+
catch (pybind11::error_already_set & e) { \
277+
PyErr_SetString(PyExc_ImportError, e.what()); \
278+
return nullptr; \
279+
} \
280+
catch (const std::exception &e) { \
281+
PyErr_SetString(PyExc_ImportError, e.what()); \
282+
return nullptr; \
283+
}
283284

284285
// clang-format off
285286
/** \rst

include/pybind11/iostream.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ class pythonbuf : public std::streambuf {
134134

135135
PYBIND11_NAMESPACE_END(detail)
136136

137-
138137
// clang-format off
139138
/** \rst
140139
This a move-only guard that redirects output.
@@ -184,7 +183,6 @@ class scoped_ostream_redirect {
184183
scoped_ostream_redirect &operator=(scoped_ostream_redirect &&) = delete;
185184
};
186185

187-
188186
// clang-format off
189187
/** \rst
190188
Like `scoped_ostream_redirect`, but redirects cerr by default. This class

tests/pybind11_tests.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
#if defined(_MSC_VER) && _MSC_VER < 1910
1010
// We get some really long type names here which causes MSVC 2015 to emit warnings
11-
# pragma warning(disable: 4503) // warning C4503: decorated name length exceeded, name was truncated
11+
# pragma warning( \
12+
disable : 4503) // warning C4503: decorated name length exceeded, name was truncated
1213
#endif
1314

1415
namespace py = pybind11;

tests/test_pytypes.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -259,22 +259,22 @@ TEST_SUBMODULE(pytypes, m) {
259259
m.def("convert_to_pybind11_str", [](py::object o) { return py::str(o); });
260260

261261
m.def("nonconverting_constructor",
262-
// NOLINTNEXTLINE(performance-unnecessary-value-param)
263-
[](std::string type, py::object value, bool move) -> py::object {
264-
if (type == "bytes") {
265-
return move ? py::bytes(std::move(value)) : py::bytes(value);
266-
}
267-
if (type == "none") {
268-
return move ? py::none(std::move(value)) : py::none(value);
269-
}
270-
if (type == "ellipsis") {
271-
return move ? py::ellipsis(std::move(value)) : py::ellipsis(value);
272-
}
273-
if (type == "type") {
274-
return move ? py::type(std::move(value)) : py::type(value);
275-
}
276-
throw std::runtime_error("Invalid type");
277-
});
262+
// NOLINTNEXTLINE(performance-unnecessary-value-param)
263+
[](std::string type, py::object value, bool move) -> py::object {
264+
if (type == "bytes") {
265+
return move ? py::bytes(std::move(value)) : py::bytes(value);
266+
}
267+
if (type == "none") {
268+
return move ? py::none(std::move(value)) : py::none(value);
269+
}
270+
if (type == "ellipsis") {
271+
return move ? py::ellipsis(std::move(value)) : py::ellipsis(value);
272+
}
273+
if (type == "type") {
274+
return move ? py::type(std::move(value)) : py::type(value);
275+
}
276+
throw std::runtime_error("Invalid type");
277+
});
278278

279279
m.def("get_implicit_casting", []() {
280280
py::dict d;

0 commit comments

Comments
 (0)