From f20c160c0624ee564c7e05e8c17fac8b7c35d4c8 Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Wed, 7 Feb 2001 17:52:03 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/showbase/Finder.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/direct/src/showbase/Finder.py b/direct/src/showbase/Finder.py index e999a4ad55..2e4e2723f6 100644 --- a/direct/src/showbase/Finder.py +++ b/direct/src/showbase/Finder.py @@ -130,15 +130,17 @@ def copyFuncs(fromClass, toClass): for key in fromClass.__dict__.keys(): value = fromClass.__dict__[key] if (type(value) == types.FunctionType): - oldFunc = toClass.__dict__[key] newFunc = value - # Look in the messenger to see if this old function pointer - # is stored, and update it to the new function pointer - replaceMessengerFunc(oldFunc, newFunc) + # See if we already have a function with this name + if toClass.__dict__.has_key(key): + # Look in the messenger to see if this old function pointer + # is stored, and update it to the new function pointer + oldFunc = toClass.__dict__[key] + replaceMessengerFunc(oldFunc, newFunc) toClass.__dict__[key] = newFunc def replaceMessengerFunc(oldFunc, newFunc): res = messenger.replaceMethod(oldFunc, newFunc) if res: - print ('messenger replaced function: ' + newFunc.__name__) + print ('replaced messenger function: ' + newFunc.__name__)