Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch: json-decoder-maps-py3.6
Changeset: r96793:36f4881e7ef5
Date: 2019-06-11 13:31 +0200
http://bitbucket.org/pypy/pypy/changeset/36f4881e7ef5/

Log:    test and fix

diff --git a/pypy/module/_pypyjson/interp_decoder.py 
b/pypy/module/_pypyjson/interp_decoder.py
--- a/pypy/module/_pypyjson/interp_decoder.py
+++ b/pypy/module/_pypyjson/interp_decoder.py
@@ -280,8 +280,8 @@
     def _raise_object_error(self, ch, start, i):
         if ch == '\0':
             self._raise("Unterminated object starting at", start)
-        else:
-            self._raise("Unexpected '%s' when decoding object (char %d)" % ch, 
i)
+        else:?!?jedi=0, ?!?          (*_*param msg*_*, param pos) ?!?jedi?!?
+            self._raise("Unexpected '%s' when decoding object" % ch, i)
 
     def decode_array(self, i):
         """ Decode a list. i must be after the opening '[' """
diff --git a/pypy/module/_pypyjson/test/test__pypyjson.py 
b/pypy/module/_pypyjson/test/test__pypyjson.py
--- a/pypy/module/_pypyjson/test/test__pypyjson.py
+++ b/pypy/module/_pypyjson/test/test__pypyjson.py
@@ -488,6 +488,7 @@
             ('["]', 'Unterminated string starting at', 1),
             ('["spam":', "Unexpected ':' when decoding array", 7),
             ('[{]', "Key name must be string at char", 2),
+            ('{"a": 1 "b": 2}', "Unexpected '\"' when decoding object", 8),
         ]
         for inputtext, errmsg, errpos in test_cases:
             exc = raises(ValueError, _pypyjson.loads, inputtext)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to