[pypy-dev] Catching MemoryError in RPython

Armin Rigo arigo at tunes.org
Tue Feb 26 15:54:23 CET 2008


Hi Holger,

On Sat, Feb 23, 2008 at 02:33:23PM +0100, holger krekel wrote:
> the "range" and "lst.append" in Niko's example are not 
> considered to be function calls?

Good point.  The range() and lst.append() are function calls, so the
flow space keeps the MemoryError catching path.  (That's not the case
for the creation of the empty list done in the loop.)  However, what
occurs is that the rtyper kills these paths because rlist.py says that
append() cannot raise.  This could be changed in the rtyper to
systematically keep the MemoryError path (not just for append() but
generally).  However I think that going for half-fixes like this one is
not a good idea.  Either we do a 100% solution that would include the
flow space issue, or we keep the special rule about how we are supposed
to catch MemoryError in RPython.


A bientot,

Armin.



More information about the Pypy-dev mailing list