[pypy-svn] r18822 - in pypy/dist/pypy/interpreter: . test
arigo at codespeak.net
arigo at codespeak.net
Fri Oct 21 14:48:05 CEST 2005
Author: arigo
Date: Fri Oct 21 14:48:05 2005
New Revision: 18822
Modified:
pypy/dist/pypy/interpreter/miscutils.py
pypy/dist/pypy/interpreter/test/test_syntax.py
Log:
Just adding comments and helpful error messages.
Modified: pypy/dist/pypy/interpreter/miscutils.py
==============================================================================
--- pypy/dist/pypy/interpreter/miscutils.py (original)
+++ pypy/dist/pypy/interpreter/miscutils.py Fri Oct 21 14:48:05 2005
@@ -79,7 +79,7 @@
def pop(self):
ptr = self.ptr - 1
- ret = self.items[ptr]
+ ret = self.items[ptr] # you get OverflowError if the stack is empty
self.items[ptr] = None
self.ptr = ptr
return ret
Modified: pypy/dist/pypy/interpreter/test/test_syntax.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_syntax.py (original)
+++ pypy/dist/pypy/interpreter/test/test_syntax.py Fri Oct 21 14:48:05 2005
@@ -254,12 +254,16 @@
for s in VALID:
try:
compile(s, '?', 'exec')
- except:
+ except Exception, e:
+ print '-'*20, 'FAILED TO COMPILE:', '-'*20
print s
- raise
+ print '%s: %s' % (e.__class__, e)
+ print '-'*60
for s in INVALID:
try:
raises(SyntaxError, compile, s, '?', 'exec')
- except:
+ except Exception ,e:
+ print '-'*20, 'UNEXPECTEDLY COMPILED:', '-'*20
print s
- raise
+ print '%s: %s' % (e.__class__, e)
+ print '-'*60
More information about the Pypy-commit
mailing list