[pypy-svn] pypy default: Fix for test_transformed_gc.py.
arigo
commits-noreply at bitbucket.org
Sat Feb 26 12:21:43 CET 2011
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r42307:6dd8d5c6623f
Date: 2011-02-26 12:21 +0100
http://bitbucket.org/pypy/pypy/changeset/6dd8d5c6623f/
Log: Fix for test_transformed_gc.py.
diff --git a/pypy/rpython/llinterp.py b/pypy/rpython/llinterp.py
--- a/pypy/rpython/llinterp.py
+++ b/pypy/rpython/llinterp.py
@@ -5,6 +5,7 @@
from pypy.rpython.lltypesystem import rclass
from pypy.rpython.ootypesystem import ootype
from pypy.rlib.objectmodel import ComputedIntSymbolic, CDefinedIntSymbolic
+from pypy.rlib.objectmodel import Symbolic
from pypy.rlib import rstackovf
import sys, os
@@ -1132,7 +1133,9 @@
# special case
if type(x) is CDefinedIntSymbolic:
x = x.default
- assert isinstance(x, int)
+ # if type(x) is a subclass of Symbolic, bool(x) will usually raise
+ # a TypeError -- unless __nonzero__ has been explicitly overridden.
+ assert isinstance(x, (int, Symbolic))
return bool(x)
# read frame var support
More information about the Pypy-commit
mailing list