From 07a14ce3504c992b67e587825d9284311ef070db Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 12 Aug 2004 14:27:40 +0000 Subject: [PATCH] Clarify/don't abuse extract<> [SVN r24436] --- test/embedding.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/embedding.cpp b/test/embedding.cpp index d2bd021a..1ff38412 100644 --- a/test/embedding.cpp +++ b/test/embedding.cpp @@ -69,9 +69,8 @@ void test() Py_Initialize(); // Retrieve the main module - python::object main_module = python::extract( - PyImport_AddModule("__main__") - )(); + python::object main_module(( + python::handle<>(python::borrowed(PyImport_AddModule("__main__"))))); // Retrieve the main module's namespace python::object main_namespace((main_module.attr("__dict__"))); @@ -106,7 +105,11 @@ void test() // But now creating and using instances of the Python class is almost // as easy! python::object py_base = PythonDerived(); - Base& py = python::extract(py_base)(); + Base& py = python::extract(py_base) +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + () +#endif + ; std::cout << py.hello() << std::endl; }