[pypy-commit] pypy kill-someobject: Fixes
arigo
noreply at buildbot.pypy.org
Fri Oct 12 16:24:30 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch: kill-someobject
Changeset: r58047:fd2b3741425d
Date: 2012-10-12 16:24 +0200
http://bitbucket.org/pypy/pypy/changeset/fd2b3741425d/
Log: Fixes
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
@@ -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
More information about the pypy-commit
mailing list