Alex Gaynor committed da183cf Draft

dead import cleanup

  • Participants
  • Parent commits b0e233a
  • Branches kill-someobject

Comments (0)

Files changed (2)


-from pypy.tool.pairtype import pairtype
 from pypy.annotation import model as annmodel
-from pypy.rpython.lltypesystem import lltype
-from pypy.rpython.lltypesystem import rclass
+from pypy.rlib import objectmodel
+from pypy.rpython.lltypesystem import lltype, rclass
 from pypy.rpython.lltypesystem.rdict import rtype_r_dict
-from pypy.rlib import objectmodel
-from pypy.rpython.rmodel import TyperError, Constant
-from pypy.rpython.rbool import bool_repr
+from pypy.rpython.rmodel import TyperError
 def rtype_builtin_isinstance(hop):
 BUILTIN_TYPER[weakref.ref] = rtype_weakref_create
 BUILTIN_TYPER[llmemory.weakref_create] = rtype_weakref_create
-BUILTIN_TYPER[llmemory.weakref_deref ] = rtype_weakref_deref
+BUILTIN_TYPER[llmemory.weakref_deref] = rtype_weakref_deref
 BUILTIN_TYPER[llmemory.cast_ptr_to_weakrefptr] = rtype_cast_ptr_to_weakrefptr
 BUILTIN_TYPER[llmemory.cast_weakrefptr_to_ptr] = rtype_cast_weakrefptr_to_ptr


-from pypy.tool.pairtype import pairtype
 from pypy.annotation import model as annmodel
 from pypy.objspace.flow.model import Constant
-from pypy.rpython.lltypesystem import lltype, rclass, llmemory
-from pypy.rpython import rint, raddress
 from pypy.rlib import rarithmetic, objectmodel
+from pypy.rpython import raddress, rptr, extregistry
 from pypy.rpython.error import TyperError
-from pypy.rpython.rmodel import Repr, IntegerRepr, inputconst
-from pypy.rpython.rrange import rtype_builtin_range, rtype_builtin_xrange
-from pypy.rpython.rrange import rtype_builtin_enumerate
-from pypy.rpython import rstr
-from pypy.rpython import rptr
-from pypy.tool import sourcetools
-from pypy.rpython import extregistry
+from pypy.rpython.lltypesystem import lltype, llmemory
+from pypy.rpython.rmodel import Repr
+from pypy.tool.pairtype import pairtype
 class __extend__(annmodel.SomeBuiltin):
     def rtyper_makerepr(self, rtyper):
     kwds_i = {}
     for i, key in enumerate(keywords):
         index = arguments.keywords_w[i]
-        kwds_i['i_'+key] = index
+        kwds_i['i_' + key] = index
     return hop, kwds_i
     r_func, nimplicitarg = r_callable.get_r_implfunc()
     s_callable = r_callable.get_s_callable()
-    nbargs = len(hop.args_s) - 1 + nimplicitarg 
+    nbargs = len(hop.args_s) - 1 + nimplicitarg
     s_sigs = r_func.get_s_signatures((nbargs, (), False, False))
     if len(s_sigs) != 1:
         raise TyperError("cannot hlinvoke callable %r with not uniform"
 # collect all functions
-import __builtin__, exceptions
+import __builtin__
 for name, value in globals().items():
     if name.startswith('rtype_builtin_'):
     hop.has_implicit_exception(MemoryError)   # record that we know about it
-    return hop.genop(opname, vlist, resulttype = hop.r_result.lowleveltype)
+    return hop.genop(opname, vlist, resulttype=hop.r_result.lowleveltype)
 def rtype_free(hop, i_flavor, i_track_allocation=None):
     vlist = [hop.inputarg(hop.args_r[0], arg=0)]
         elif ORIG == llmemory.Address:
             return llops.genop('cast_adr_to_ptr', [v_value], resulttype = TGT)
         elif isinstance(ORIG, lltype.Primitive):
-            v_value = gen_cast(llops, lltype.Signed, v_value)            
+            v_value = gen_cast(llops, lltype.Signed, v_value)
             return llops.genop('cast_int_to_ptr', [v_value], resulttype=TGT)
     elif TGT == llmemory.Address and isinstance(ORIG, lltype.Ptr):
         return llops.genop('cast_ptr_to_adr', [v_value], resulttype = TGT)
     flags = {'flavor': flavor}
     cflags = hop.inputconst(lltype.Void, flags)
     return hop.genop('free', [vinst, cflags])
 BUILTIN_TYPER[objectmodel.free_non_gc_object] = rtype_free_non_gc_object
 # keepalive_until_here
 BUILTIN_TYPER[llmemory.cast_adr_to_ptr] = rtype_cast_adr_to_ptr
 BUILTIN_TYPER[llmemory.cast_adr_to_int] = rtype_cast_adr_to_int
 BUILTIN_TYPER[llmemory.cast_int_to_adr] = rtype_cast_int_to_adr