[pypy-svn] r75923 - in pypy/branch/fast-forward/pypy/objspace/std: . test
benjamin at codespeak.net
benjamin at codespeak.net
Tue Jul 6 17:10:21 CEST 2010
Author: benjamin
Date: Tue Jul 6 17:10:19 2010
New Revision: 75923
Modified:
pypy/branch/fast-forward/pypy/objspace/std/newformat.py
pypy/branch/fast-forward/pypy/objspace/std/test/test_newformat.py
Log:
fix untested error case
Modified: pypy/branch/fast-forward/pypy/objspace/std/newformat.py
==============================================================================
--- pypy/branch/fast-forward/pypy/objspace/std/newformat.py (original)
+++ pypy/branch/fast-forward/pypy/objspace/std/newformat.py Tue Jul 6 17:10:19 2010
@@ -123,8 +123,8 @@
if c == "!":
i += 1
if i == end:
- raise OperationError(space.w_ValueError,
- space.wrap("expected conversion"))
+ w_msg = self.space.wrap("expected conversion")
+ raise OperationError(self.space.w_ValueError, w_msg)
conversion = s[i]
else:
conversion = None
Modified: pypy/branch/fast-forward/pypy/objspace/std/test/test_newformat.py
==============================================================================
--- pypy/branch/fast-forward/pypy/objspace/std/test/test_newformat.py (original)
+++ pypy/branch/fast-forward/pypy/objspace/std/test/test_newformat.py Tue Jul 6 17:10:19 2010
@@ -73,6 +73,7 @@
def test_invalid_conversion(self):
raises(ValueError, self.s("{!x}").format, 3)
+ raises(ValueError, self.s("{!}").format)
def test_recursive(self):
assert self.s("{:{}}").format(42, "#o") == self.s("0o52")
More information about the Pypy-commit
mailing list