[pypy-svn] r11801 - pypy/dist/lib-python/modified-2.3.4/test

arigo at codespeak.net arigo at codespeak.net
Mon May 2 19:32:51 CEST 2005


Author: arigo
Date: Mon May  2 19:32:51 2005
New Revision: 11801

Added:
   pypy/dist/lib-python/modified-2.3.4/test/test_operations.py
      - copied, changed from r11792, pypy/dist/lib-python/2.3.4/test/test_operations.py
Log:
Dict operations swallow some exceptions in CPython.
There is a test checking that.  Argh.
Fixed the test to mean "either swallow or not, but doesn't crash".


Copied: pypy/dist/lib-python/modified-2.3.4/test/test_operations.py (from r11792, pypy/dist/lib-python/2.3.4/test/test_operations.py)
==============================================================================
--- pypy/dist/lib-python/2.3.4/test/test_operations.py	(original)
+++ pypy/dist/lib-python/modified-2.3.4/test/test_operations.py	Mon May  2 19:32:51 2005
@@ -32,8 +32,14 @@
 d = {}
 x1 = BadDictKey()
 x2 = BadDictKey()
-d[x1] = 1
-d[x2] = 2
+try:
+    d[x1] = 1
+except RuntimeError:
+    pass   # N.B. CPython swallows the exception entierely
+try:
+    d[x2] = 2
+except RuntimeError:
+    pass
 print "No exception passed through."
 
 # Dict resizing bug, found by Jack Jansen in 2.2 CVS development.



More information about the Pypy-commit mailing list