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

Function errmsg

simplejson/errors.py:15–23  ·  view source on GitHub ↗
(msg, doc, pos, end=None)

Source from the content-addressed store, hash-verified

13
14
15def errmsg(msg, doc, pos, end=None):
16 lineno, colno = linecol(doc, pos)
17 msg = msg.replace('%r', repr(doc[pos:pos + 1]))
18 if end is None:
19 fmt = '%s: line %d column %d (char %d)'
20 return fmt % (msg, lineno, colno, pos)
21 endlineno, endcolno = linecol(doc, end)
22 fmt = '%s: line %d column %d - line %d column %d (char %d - %d)'
23 return fmt % (msg, lineno, colno, endlineno, endcolno, pos, end)
24
25
26class JSONDecodeError(ValueError):

Callers 1

__init__Method · 0.85

Calls 1

linecolFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…