Esempio n. 1
0
 def createcompiler(self):
     "Factory function creating a compiler object."
     # XXX simple selection logic for now
     try:
         return self.default_compiler
     except AttributeError:
         if self.config.objspace.compiler == 'cpython':
             compiler = CPythonCompiler(self)
         elif self.config.objspace.compiler == 'ast':
             compiler = PythonAstCompiler(self)
         else:
             raise ValueError('unknown --compiler option value: %r' %
                              (self.config.objspace.compiler, ))
         self.default_compiler = compiler
         return compiler
Esempio n. 2
0
 def setup_method(self, method):
     self.compiler = PythonAstCompiler(self.space, "2.5")