From cf15a99730e623a5e23ba1b1947129f63af75bad Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 8 Aug 2002 06:14:48 +0000 Subject: [PATCH] Repair type initialization problem [SVN r14736] --- src/object/function.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/object/function.cpp b/src/object/function.cpp index eb842a65..c2d36075 100644 --- a/src/object/function.cpp +++ b/src/object/function.cpp @@ -24,7 +24,11 @@ function::function(py_function const& implementation, unsigned min_args, unsigne , m_max_args(std::max(max_args,min_args)) { PyObject* p = this; - ::PyType_Ready(&function_type); + if (function_type.ob_type == 0) + { + function_type.ob_type = &PyType_Type; + ::PyType_Ready(&function_type); + } PyObject_INIT(p, &function_type); } @@ -305,7 +309,7 @@ extern "C" } PyTypeObject function_type = { - PyObject_HEAD_INIT(&PyType_Type) + PyObject_HEAD_INIT(0) 0, "Boost.Python.function", sizeof(function),