Commits

Alex Gaynor committed a21178a

kill some dead imports and style cleanups

  • Participants
  • Parent commits c7d5af1
  • Branches kill-someobject

Comments (0)

Files changed (2)

pypy/translator/c/test/test_genc.py

-import autopath, sys, os, py
+import sys
+
+import py
+
 from pypy.rpython.lltypesystem.lltype import *
 from pypy.annotation import model as annmodel
 from pypy.translator.translator import TranslationContext
-from pypy.translator.c.database import LowLevelDatabase
 from pypy.translator.c import genc
-from pypy.translator.c.gc import NoneGcPolicy
-from pypy.objspace.flow.model import Constant, Variable, SpaceOperation
-from pypy.objspace.flow.model import Block, Link, FunctionGraph
-from pypy.tool.udir import udir
-from pypy.translator.gensupp import uniquemodulename
-from pypy.translator.backendopt.all import backend_optimizations
 from pypy.translator.interactive import Translation
 from pypy.rlib.entrypoint import entrypoint
 from pypy.tool.nullpath import NullPyPathLocal
 
+
 def compile(fn, argtypes, view=False, gcpolicy="ref", backendopt=True,
             annotatorpolicy=None):
-    if argtypes is not None and "__pypy__" in sys.builtin_module_names:
-        py.test.skip("requires building cpython extension modules")
     t = Translation(fn, argtypes, gc=gcpolicy, backend="c",
                     policy=annotatorpolicy)
     if not backendopt:

pypy/translator/interactive.py

              self.ensure_setup()
         elif kind == 'post':
             pass
-            
+
     def ensure_setup(self, argtypes=None, policy=None, standalone=False):
         if not self.driver_setup:
             if standalone:
         kwds.pop('policy', None)
         kwds.pop('standalone', None)
         gc = kwds.pop('gc', None)
-        if gc: self.config.translation.gc = gc
+        if gc:
+            self.config.translation.gc = gc
         self.config.translation.set(**kwds)
 
     def ensure_opt(self, name, value=None, fallback=None):
         if val is not None:
             return val
         raise Exception(
-                    "the %r option should have been specified at this point" %name)
+                    "the %r option should have been specified at this point" % name)
 
     def ensure_type_system(self, type_system=None):
         if self.config.translation.backend is not None:
             return self.ensure_opt('type_system')
         return self.ensure_opt('type_system', type_system, 'lltype')
-        
+
     def ensure_backend(self, backend=None):
         backend = self.ensure_opt('backend', backend)
         self.ensure_type_system()
     def rtype(self, argtypes=None, **kwds):
         self.update_options(argtypes, kwds)
         ts = self.ensure_type_system()
-        return getattr(self.driver, 'rtype_'+ts)()        
+        return getattr(self.driver, 'rtype_' + ts)()
 
     def backendopt(self, argtypes=None, **kwds):
         self.update_options(argtypes, kwds)
         ts = self.ensure_type_system('lltype')
-        return getattr(self.driver, 'backendopt_'+ts)()                
-            
+        return getattr(self.driver, 'backendopt_' + ts)()
+
     # backend depedent
 
     def source(self, argtypes=None, **kwds):
         self.update_options(argtypes, kwds)
         backend = self.ensure_backend()
-        getattr(self.driver, 'source_'+backend)()
-       
+        getattr(self.driver, 'source_' + backend)()
+
     def source_c(self, argtypes=None, **kwds):
         self.update_options(argtypes, kwds)
         self.ensure_backend('c')
     def compile(self, argtypes=None, **kwds):
         self.update_options(argtypes, kwds)
         backend = self.ensure_backend()
-        getattr(self.driver, 'compile_'+backend)()
+        getattr(self.driver, 'compile_' + backend)()
         return self.driver.c_entryp
-       
+
     def compile_c(self, argtypes=None, **kwds):
         self.update_options(argtypes, kwds)
         self.ensure_backend('c')
         self.driver.compile_c()
         return self.driver.c_entryp
-  
+
     def compile_cli(self, argtypes=None, **kwds):
         self.update_options(argtypes, kwds)
         self.ensure_backend('cli')