From ffebdff24b6b42b32bdf3692c4699b624cb68055 Mon Sep 17 00:00:00 2001 From: Dan Eicher Date: Thu, 27 Jan 2011 15:58:39 -0700 Subject: [PATCH] py3k: convert ob_refcnt access to use Py_REFCNT macro --- pybindgen/cppclass_typehandlers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pybindgen/cppclass_typehandlers.py b/pybindgen/cppclass_typehandlers.py index c4c3b68..b551be8 100644 --- a/pybindgen/cppclass_typehandlers.py +++ b/pybindgen/cppclass_typehandlers.py @@ -524,7 +524,7 @@ class CppClassRefParameter(CppClassParameterBase): ## simply erased (we never owned this object in the first ## place). wrapper.after_call.write_code( - "if (%s->ob_refcnt == 1)\n" + "if (Py_REFCNT(%s) == 1)\n" " %s->obj = NULL;\n" "else{\n" % (self.py_name, self.py_name)) wrapper.after_call.indent() @@ -900,7 +900,7 @@ class CppClassPtrParameter(CppClassParameterBase): ## place). wrapper.after_call.write_code( - "if (%s->ob_refcnt == 1)\n" + "if (Py_REFCNT(%s) == 1)\n" " %s->obj = NULL;\n" "else {\n" % (self.py_name, self.py_name)) wrapper.after_call.indent()