From e5df1da408f2df6e0eb715eaed08afb27ba5932e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 31 May 2017 20:16:49 -0700 Subject: [PATCH] A better fix. Use reference params so a None won't get far enough to cause a problem. --- etg/treectrl.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/etg/treectrl.py b/etg/treectrl.py index a5dde736..933d4b3c 100644 --- a/etg/treectrl.py +++ b/etg/treectrl.py @@ -42,12 +42,10 @@ def run(): return self->IsOk(); """) - c.addCppMethod('bool', '__eq__', '(const wxTreeItemId* other)', """\ - if (other == NULL) return false; + c.addCppMethod('bool', '__eq__', '(const wxTreeItemId& other)', """\ return *self == *other; """) - c.addCppMethod('bool', '__neq__', '(const wxTreeItemId* other)', """\ - if (other == NULL) return true; + c.addCppMethod('bool', '__neq__', '(const wxTreeItemId& other)', """\ return *self != *other; """) @@ -55,6 +53,9 @@ def run(): return hash(int(self.GetID())) """) + module.find('operator==').ignore() + module.find('operator!=').ignore() + td = etgtools.TypedefDef(name='wxTreeItemIdValue', type='void*') module.insertItemBefore(c, td)