diff --git a/direct/src/distributed/ClientRepository.py b/direct/src/distributed/ClientRepository.py index bbea93222d..5d4e63a525 100644 --- a/direct/src/distributed/ClientRepository.py +++ b/direct/src/distributed/ClientRepository.py @@ -324,6 +324,3 @@ class ClientRepository(DirectObject.DirectObject): cdu.func = newMethod foundIt = 1 return foundIt - - - diff --git a/direct/src/showbase/Finder.py b/direct/src/showbase/Finder.py index a27082e1fc..d5b34434f4 100644 --- a/direct/src/showbase/Finder.py +++ b/direct/src/showbase/Finder.py @@ -66,7 +66,7 @@ def rebindClass(builtins, filename): parenLoc = classHeader.find('(') if parenLoc > 0: className = classHeader[:parenLoc] - # print 'found className: ' + className + print 'Rebinding class name: ' + className found = 1 foundLine = i foundChar = parenLoc @@ -156,6 +156,12 @@ def replaceStateFunc(oldFunc, newFunc): print ('replaced state exit function: ' + newFunc.__name__) def replaceTcrFunc(oldFunc, newFunc): - res = toonbase.tcr.replaceMethod(oldFunc, newFunc) + try: + res = toonbase.tcr.replaceMethod(oldFunc, newFunc) + except: + try: + res = simbase.air.replaceMethod(oldFunc, newFunc) + except: + res = None if res: print ('replaced DistributedObject function: ' + newFunc.__name__)