From ba60d4818bff01eca1d14817e911b0d2f4410824 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sun, 14 Sep 2008 18:34:08 +0000 Subject: [PATCH] Register to_python converter for shared_ptr --- bindings/python/src/entry.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bindings/python/src/entry.cpp b/bindings/python/src/entry.cpp index b24f6a2cf..861580708 100644 --- a/bindings/python/src/entry.cpp +++ b/bindings/python/src/entry.cpp @@ -49,6 +49,13 @@ struct entry_to_python } } + static PyObject* convert(boost::shared_ptr const& e) + { + if (!e) + return incref(Py_None); + return convert(*e); + } + static PyObject* convert(entry const& e) { return incref(convert0(e).ptr()); @@ -126,6 +133,7 @@ struct entry_from_python void bind_entry() { + to_python_converter, entry_to_python>(); to_python_converter(); entry_from_python(); }