Author: Ronan Lamy <[email protected]>
Branch: py3.6
Changeset: r97234:63e7c409be9a
Date: 2019-08-21 18:00 +0100
http://bitbucket.org/pypy/pypy/changeset/63e7c409be9a/

Log:    fix error message

diff --git a/pypy/objspace/std/intobject.py b/pypy/objspace/std/intobject.py
--- a/pypy/objspace/std/intobject.py
+++ b/pypy/objspace/std/intobject.py
@@ -964,7 +964,7 @@
                 s = unicode_to_decimal_w(space, w_value)
             except Exception:
                 raise oefmt(space.w_ValueError,
-                            'invalid literal for int() with base %d: %S',
+                            'invalid literal for int() with base %d: %R',
                             base, w_value)
         elif (space.isinstance_w(w_value, space.w_bytes) or
               space.isinstance_w(w_value, space.w_bytearray)):
diff --git a/pypy/objspace/std/test/test_intobject.py 
b/pypy/objspace/std/test/test_intobject.py
--- a/pypy/objspace/std/test/test_intobject.py
+++ b/pypy/objspace/std/test/test_intobject.py
@@ -589,6 +589,8 @@
         value = u'123\ud800'
         e = raises(ValueError, int, value)
         assert str(e.value) == u"invalid literal for int() with base 10: %r" % 
value
+        e = raises(ValueError, int, value, 10)
+        assert str(e.value) == u"invalid literal for int() with base 10: %r" % 
value
 
     def test_non_numeric_input_types(self):
         # Test possible non-numeric types for the argument x, including
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to