[pypy-svn] r15357 - pypy/dist/pypy/interpreter

arigo at codespeak.net arigo at codespeak.net
Fri Jul 29 17:18:21 CEST 2005


Author: arigo
Date: Fri Jul 29 17:18:19 2005
New Revision: 15357

Modified:
   pypy/dist/pypy/interpreter/miscutils.py
Log:
Explicitly check for this IndexError, because some callers expect it.


Modified: pypy/dist/pypy/interpreter/miscutils.py
==============================================================================
--- pypy/dist/pypy/interpreter/miscutils.py	(original)
+++ pypy/dist/pypy/interpreter/miscutils.py	Fri Jul 29 17:18:19 2005
@@ -34,6 +34,8 @@
         and so on.  It must not be negative."""
         if position < 0:
             raise ValueError, 'negative stack position'
+        if position >= len(self.items):
+            raise IndexError, 'not enough entries in stack'
         return self.items[~position]
 
     def depth(self):



More information about the Pypy-commit mailing list