3636
3737# Will be parsed by setup.py to determine package metadata
3838__author__ = 'Stefan Kögl <stefan@skoegl.net>'
39- __version__ = '1.4 '
39+ __version__ = '1.5 '
4040__website__ = 'https://github.com/stefankoegl/python-json-pointer'
4141__license__ = 'Modified BSD License'
4242
@@ -148,10 +148,6 @@ def __repr__(self):
148148class JsonPointer (object ):
149149 """A JSON Pointer that can reference parts of an JSON document"""
150150
151- _GETITEM_SUPPORT_ERROR = """document '%s' does not support indexing,
152- must be mapping/sequence
153- or support __getitem__"""
154-
155151 # Array indices must not contain:
156152 # leading zeros, signs, spaces, decimals, etc
157153 _RE_ARRAY_INDEX = re .compile ('0|[1-9][0-9]*$' )
@@ -232,7 +228,8 @@ def get_part(self, doc, part):
232228 return part
233229
234230 else :
235- raise JsonPointerException (self ._GETITEM_SUPPORT_ERROR % type (doc ))
231+ raise JsonPointerException ("document '%s' does not support indexing, "
232+ "must be mapping/sequence or support __getitem__" % type (doc ))
236233
237234 def walk (self , doc , part ):
238235 """Walks one step in doc and returns the referenced part"""
@@ -258,7 +255,7 @@ def walk(self, doc, part):
258255 return doc [part ]
259256
260257 except IndexError :
261- raise JsonPointerException ("index '%s' is out of bounds" % part )
258+ raise JsonPointerException ("index '%s' is out of bounds" % ( part , ) )
262259
263260 else :
264261 # Object supports __getitem__, assume custom indexing
0 commit comments