[pypy-svn] r47837 - in pypy/dist/pypy/rpython: . lltypesystem
arigo at codespeak.net
arigo at codespeak.net
Wed Oct 24 17:19:56 CEST 2007
Author: arigo
Date: Wed Oct 24 17:19:56 2007
New Revision: 47837
Modified:
pypy/dist/pypy/rpython/llinterp.py
pypy/dist/pypy/rpython/lltypesystem/lltype.py
Log:
Forgot to check this in.
Modified: pypy/dist/pypy/rpython/llinterp.py
==============================================================================
--- pypy/dist/pypy/rpython/llinterp.py (original)
+++ pypy/dist/pypy/rpython/llinterp.py Wed Oct 24 17:19:56 2007
@@ -699,7 +699,7 @@
self.heap.free(obj, flavor=flavor)
def op_zero_gc_pointers_inside(self, obj):
- pass
+ raise NotImplementedError("zero_gc_pointers_inside")
def op_getfield(self, obj, field):
checkptr(obj)
Modified: pypy/dist/pypy/rpython/lltypesystem/lltype.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/lltype.py (original)
+++ pypy/dist/pypy/rpython/lltypesystem/lltype.py Wed Oct 24 17:19:56 2007
@@ -1077,8 +1077,11 @@
def __iter__(self):
# this is a work-around for the 'isrpystring' hack in __getitem__,
# which otherwise causes list(p) to include the extra \x00 character.
- for i in range(len(self)):
- yield self[i]
+ if isinstance(self._T, (Array, FixedSizeArray)):
+ for i in range(self._obj.getlength()):
+ yield self[i]
+ else:
+ raise TypeError("%r instance is not an array" % (self._T,))
def __repr__(self):
return '<%s>' % (self,)
More information about the Pypy-commit
mailing list