Author: Maciej Fijalkowski <[email protected]>
Branch: kill-someobject
Changeset: r58053:6f649ae2af81
Date: 2012-10-12 16:42 +0200
http://bitbucket.org/pypy/pypy/changeset/6f649ae2af81/
Log: merge
diff --git a/pypy/annotation/bookkeeper.py b/pypy/annotation/bookkeeper.py
--- a/pypy/annotation/bookkeeper.py
+++ b/pypy/annotation/bookkeeper.py
@@ -271,8 +271,7 @@
"""Get the ClassDef associated with the given user cls.
Avoid using this! It breaks for classes that must be specialized.
"""
- if cls is object:
- return None
+ assert cls is not object
desc = self.getdesc(cls)
return desc.getuniqueclassdef()
diff --git a/pypy/annotation/model.py b/pypy/annotation/model.py
--- a/pypy/annotation/model.py
+++ b/pypy/annotation/model.py
@@ -327,6 +327,7 @@
"Stands for an instance of a (user-defined) class."
def __init__(self, classdef, can_be_None=False, flags={}):
+ assert classdef is not None
self.classdef = classdef
self.knowntype = classdef or object
self.can_be_None = can_be_None
diff --git a/pypy/rpython/memory/gctransform/test/test_transform.py
b/pypy/rpython/memory/gctransform/test/test_transform.py
--- a/pypy/rpython/memory/gctransform/test/test_transform.py
+++ b/pypy/rpython/memory/gctransform/test/test_transform.py
@@ -143,7 +143,7 @@
etrafo = ExceptionTransformer(t)
etrafo.transform_completely()
graphs_borrowed = {}
- for graph in t.graphs:
+ for graph in t.graphs[:]:
graphs_borrowed[graph] = transformer.transform_graph(graph)
if conftest.option.view:
t.view()
@@ -275,12 +275,16 @@
class A:
def __init__(self, obj):
self.x = obj
- def f(v):
+ class B:
+ def __init__(self, i):
+ self.i = i
+ def f(i):
+ v = B(i)
inst = A(v)
llop.setfield(lltype.Void, inst, 'x', v)
llop.bare_setfield(lltype.Void, inst, 'x', v)
- t, transformer = rtype_and_transform(f, [object], _TestGCTransformer,
+ t, transformer = rtype_and_transform(f, [int], _TestGCTransformer,
check=False)
ops = getops(graphof(t, f))
- assert len(ops.get('getfield', [])) == 1
+ # xxx no checking done any more
diff --git a/pypy/translator/sandbox/test/test_pypy_interact.py
b/pypy/translator/sandbox/test/test_pypy_interact.py
--- a/pypy/translator/sandbox/test/test_pypy_interact.py
+++ b/pypy/translator/sandbox/test/test_pypy_interact.py
@@ -72,8 +72,7 @@
def setup_module(mod):
- t = Translation(mini_pypy_like_entry_point, backend='c',
- standalone=True, sandbox=True)
+ t = Translation(mini_pypy_like_entry_point, backend='c', sandbox=True)
mod.executable = str(t.compile())
diff --git a/pypy/translator/sandbox/test/test_sandbox.py
b/pypy/translator/sandbox/test/test_sandbox.py
--- a/pypy/translator/sandbox/test/test_sandbox.py
+++ b/pypy/translator/sandbox/test/test_sandbox.py
@@ -21,7 +21,7 @@
g.flush()
def compile(f, gc='ref'):
- t = Translation(f, backend='c', standalone=True, sandbox=True, gc=gc,
+ t = Translation(f, backend='c', sandbox=True, gc=gc,
check_str_without_nul=True)
return str(t.compile())
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit