MCPcopy Create free account
hub / github.com/simplejson/simplejson / get_exc

Method get_exc

simplejson/tests/test_scanstring.py:235–240  ·  view source on GitHub ↗
(scanstring, s)

Source from the content-addressed store, hash-verified

233 return
234
235 def get_exc(scanstring, s):
236 try:
237 scanstring(s, 0, None, True)
238 except json.JSONDecodeError as e:
239 return (e.pos, str(e).split(':')[0])
240 return None
241
242 # Each case: (input, expected_pos, expected_message_prefix)
243 # expected_pos == -2 means (-1, 'Unterminated string starting at');

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected