Browse Source

fixed cell object error, but line numbers are going to be gone again

Joe Shochet 19 years ago
parent
commit
d65a0d2084
1 changed files with 10 additions and 6 deletions
  1. 10 6
      direct/src/showbase/Finder.py

+ 10 - 6
direct/src/showbase/Finder.py

@@ -101,8 +101,12 @@ def copyFuncs(fromClass, toClass):
             # See if we already have a function with this name
             oldFunc = toClass.__dict__.get(funcName)
             if oldFunc:
+
+                """
+                # This code is nifty, but with nested functions, give an error:
+                #   SystemError: cellobject.c:22: bad argument to internal function
                 # Give the new function code the same filename as the old function
-                # Perhaps there is a cleaner way to do this? This is my best idea.
+                # Perhaps there is a cleaner way to do this? This was my best idea.
                 newCode = new.code(newFunc.func_code.co_argcount,
                                    newFunc.func_code.co_nlocals,
                                    newFunc.func_code.co_stacksize,
@@ -116,12 +120,12 @@ def copyFuncs(fromClass, toClass):
                                    newFunc.func_code.co_name,
                                    newFunc.func_code.co_firstlineno,
                                    newFunc.func_code.co_lnotab)
-                # print 'creating new function:', newFunc.func_code.co_name
                 newFunc = new.function(newCode,
-                                       oldFunc.func_globals,
-                                       oldFunc.func_name,
-                                       oldFunc.func_defaults)
-                                       # oldFunc.func_closure)
+                                       newFunc.func_globals,
+                                       newFunc.func_name,
+                                       newFunc.func_defaults,
+                                       newFunc.func_closure)
+                """
                 replaceFuncList.append((oldFunc, funcName, newFunc))
             else:
                 # TODO: give these new functions a proper code filename