Author: Armin Rigo <[email protected]>
Branch:
Changeset: r58703:035415613de7
Date: 2012-11-03 17:59 +0000
http://bitbucket.org/pypy/pypy/changeset/035415613de7/
Log: Translation fix. Hack differently, only when we actually make a
SomePBC containing several classes.
diff --git a/pypy/annotation/bookkeeper.py b/pypy/annotation/bookkeeper.py
--- a/pypy/annotation/bookkeeper.py
+++ b/pypy/annotation/bookkeeper.py
@@ -535,11 +535,6 @@
raise Exception("%s: %r" % (msg, pyobj))
result = self.getfrozen(pyobj)
self.descs[pyobj] = result
- #
- if (isinstance(result, description.ClassDesc) and
- not result.specialize):
- result.getuniqueclassdef() # force it: see rpython/test's
- # test_rpbc.test_pbc_of_classes_not_all_used
return result
def have_seen(self, x):
diff --git a/pypy/annotation/model.py b/pypy/annotation/model.py
--- a/pypy/annotation/model.py
+++ b/pypy/annotation/model.py
@@ -384,6 +384,14 @@
desc, = descriptions
if desc.pyobj is not None:
self.const = desc.pyobj
+ elif len(descriptions) > 1:
+ from pypy.annotation.description import ClassDesc
+ if self.getKind() is ClassDesc:
+ # a PBC of several classes: enforce them all to be
+ # built, without support for specialization. See
+ # rpython/test/test_rpbc.test_pbc_of_classes_not_all_used
+ for desc in descriptions:
+ desc.getuniqueclassdef()
def any_description(self):
return iter(self.descriptions).next()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit