def setUp(self): transformers = sys.get_code_transformers() self.addCleanup(sys.set_code_transformers, transformers) # Disable all code tranformers, we specialized functions # manually in tests sys.set_code_transformers([])
def _register(): # First, import the fat module to create the copy of the builtins dict import fat import sys config = Config() config.enable_all() if sys.flags.verbose: config.logger = sys.stderr transformers = sys.get_code_transformers() # add the FAT optimizer before the peephole optimizer transformers.insert(0, FATOptimizer(config)) sys.set_code_transformers(transformers)