diff --git a/include/pybind11/iostream.h b/include/pybind11/iostream.h index 59d33e91f..7f34bb201 100644 --- a/include/pybind11/iostream.h +++ b/include/pybind11/iostream.h @@ -104,10 +104,8 @@ PYBIND11_NAMESPACE_END(detail) .. code-block:: cpp { - py::scoped_ostream_redirect output{ - std::cerr, - py::module::import("sys").attr("stderr") - }; + py::scoped_ostream_redirect output{std::cerr, py::module::import("sys").attr("stderr")}; + std::cout << "Hello, World!"; } \endrst */ class scoped_ostream_redirect {