diff --git a/include/pybind11/iostream.h b/include/pybind11/iostream.h index 3caf55639..182e8eefd 100644 --- a/include/pybind11/iostream.h +++ b/include/pybind11/iostream.h @@ -194,7 +194,7 @@ inline class_ add_ostream_redirect(module m, std::strin return class_(m, name.c_str(), module_local()) .def(init(), arg("stdout")=true, arg("stderr")=true) .def("__enter__", &detail::OstreamRedirect::enter) - .def("__exit__", [](detail::OstreamRedirect &self, args) { self.exit(); }); + .def("__exit__", [](detail::OstreamRedirect &self_, args) { self_.exit(); }); } NAMESPACE_END(PYBIND11_NAMESPACE)