[pypy-svn] r80016 - in pypy/branch/fast-forward: lib-python/modified-2.7.0/test pypy/objspace/std

afa at codespeak.net afa at codespeak.net
Mon Dec 13 01:03:06 CET 2010


Author: afa
Date: Mon Dec 13 01:03:05 2010
New Revision: 80016

Added:
   pypy/branch/fast-forward/lib-python/modified-2.7.0/test/test_unpack.py
      - copied, changed from r79877, pypy/branch/fast-forward/lib-python/2.7.0/test/test_unpack.py
Modified:
   pypy/branch/fast-forward/pypy/objspace/std/objspace.py
Log:
PyPy provides better error messages than CPython


Copied: pypy/branch/fast-forward/lib-python/modified-2.7.0/test/test_unpack.py (from r79877, pypy/branch/fast-forward/lib-python/2.7.0/test/test_unpack.py)
==============================================================================
--- pypy/branch/fast-forward/lib-python/2.7.0/test/test_unpack.py	(original)
+++ pypy/branch/fast-forward/lib-python/modified-2.7.0/test/test_unpack.py	Mon Dec 13 01:03:05 2010
@@ -62,14 +62,14 @@
     >>> a, b = t
     Traceback (most recent call last):
       ...
-    ValueError: too many values to unpack
+    ValueError: expected length 2, got 3
 
 Unpacking tuple of wrong size
 
     >>> a, b = l
     Traceback (most recent call last):
       ...
-    ValueError: too many values to unpack
+    ValueError: expected length 2, got 3
 
 Unpacking sequence too short
 

Modified: pypy/branch/fast-forward/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/branch/fast-forward/pypy/objspace/std/objspace.py	(original)
+++ pypy/branch/fast-forward/pypy/objspace/std/objspace.py	Mon Dec 13 01:03:05 2010
@@ -346,7 +346,7 @@
 
     def _wrap_expected_length(self, expected, got):
         return OperationError(self.w_ValueError,
-                self.wrap("Expected length %d, got %d" % (expected, got)))
+                self.wrap("expected length %d, got %d" % (expected, got)))
 
     def unpackiterable(self, w_obj, expected_length=-1):
         if isinstance(w_obj, W_TupleObject):



More information about the Pypy-commit mailing list