Skip to content

Commit 3ce253f

Browse files
committed
Remove unused JSONPointerEncodeError
1 parent a517bb8 commit 3ce253f

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

docs/exceptions.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ Each of the following exceptions has a `token` property, referencing the [`Token
2020
::: jsonpath.JSONPointerError
2121
handler: python
2222

23-
::: jsonpath.JSONPointerEncodeError
24-
handler: python
25-
2623
::: jsonpath.JSONPointerResolutionError
2724
handler: python
2825

jsonpath/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from .exceptions import JSONPathNameError
1111
from .exceptions import JSONPathSyntaxError
1212
from .exceptions import JSONPathTypeError
13-
from .exceptions import JSONPointerEncodeError
1413
from .exceptions import JSONPointerError
1514
from .exceptions import JSONPointerIndexError
1615
from .exceptions import JSONPointerKeyError
@@ -52,7 +51,6 @@
5251
"JSONPathSyntaxError",
5352
"JSONPathTypeError",
5453
"JSONPointer",
55-
"JSONPointerEncodeError",
5654
"JSONPointerError",
5755
"JSONPointerIndexError",
5856
"JSONPointerKeyError",

jsonpath/exceptions.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""JSONPath exceptions."""
2+
23
from __future__ import annotations
34

45
from typing import TYPE_CHECKING
@@ -80,10 +81,6 @@ class JSONPointerError(Exception):
8081
"""Base class for all JSON Pointer errors."""
8182

8283

83-
class JSONPointerEncodeError(JSONPointerError):
84-
"""An exception raised when a JSONPathMatch can't be encoded to a JSON Pointer."""
85-
86-
8784
class JSONPointerResolutionError(JSONPointerError):
8885
"""Base exception for those that can be raised during pointer resolution."""
8986

@@ -145,7 +142,7 @@ class JSONPatchTestFailure(JSONPatchError): # noqa: N818
145142
def _truncate_message(value: str, num: int, end: str = "...") -> str:
146143
if len(value) < num:
147144
return value
148-
return f"{value[:num-len(end)]}{end}"
145+
return f"{value[: num - len(end)]}{end}"
149146

150147

151148
def _truncate_words(val: str, num: int, end: str = "...") -> str:

0 commit comments

Comments
 (0)