Commits

Christian Tismer committed ba53e76

removed the new module

Comments (0)

Files changed (1)

 import sys
 import os
 import types
-import new
 import StringIO
 
 """
 
         def func_with_new_globals(func, globals):
             """Make a copy of a function with new globals."""
-            f = new.function(func.func_code, globals,
-                             func.func_name, func.func_defaults,
-                             func.func_closure)
+            f = types.FunctionType(func.func_code, globals,
+                                   func.func_name, func.func_defaults,
+                                   func.func_closure)
             if func.func_dict:
                 f.func_dict = {}
                 f.func_dict.update(func.func_dict)