Author: Alex Gaynor <[email protected]>
Branch: kill-someobject
Changeset: r57930:da183cf8bd49
Date: 2012-10-08 15:24 +0200
http://bitbucket.org/pypy/pypy/changeset/da183cf8bd49/
Log: dead import cleanup
diff --git a/pypy/rpython/lltypesystem/rbuiltin.py
b/pypy/rpython/lltypesystem/rbuiltin.py
--- a/pypy/rpython/lltypesystem/rbuiltin.py
+++ b/pypy/rpython/lltypesystem/rbuiltin.py
@@ -1,11 +1,9 @@
-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):
hop.exception_cannot_occur()
@@ -87,6 +85,6 @@
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
diff --git a/pypy/rpython/rbuiltin.py b/pypy/rpython/rbuiltin.py
--- a/pypy/rpython/rbuiltin.py
+++ b/pypy/rpython/rbuiltin.py
@@ -1,17 +1,12 @@
-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):
@@ -80,7 +75,7 @@
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
@@ -303,7 +298,7 @@
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"
@@ -332,7 +327,7 @@
# collect all functions
-import __builtin__, exceptions
+import __builtin__
BUILTIN_TYPER = {}
for name, value in globals().items():
if name.startswith('rtype_builtin_'):
@@ -384,7 +379,7 @@
hop.has_implicit_exception(MemoryError) # record that we know about it
hop.exception_is_here()
- 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)]
@@ -504,7 +499,7 @@
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)
@@ -632,7 +627,7 @@
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
@@ -682,4 +677,3 @@
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
-
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit