Skip to content

Commit

Permalink
Attempt 6
Browse files Browse the repository at this point in the history
  • Loading branch information
nineteendo committed Sep 25, 2024
1 parent 97d4c90 commit 6210975
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/jsonyx/_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
]

import re
import sys
from codecs import (
BOM_UTF8, BOM_UTF16_BE, BOM_UTF16_LE, BOM_UTF32_BE, BOM_UTF32_LE,
)
Expand Down Expand Up @@ -196,9 +197,15 @@ def __init__(
doc.rfind("\n", 0, end), doc.rfind("\r", 0, end),
)
offset, text, end_offset = _get_err_context(doc, start, end)
super().__init__(
msg, (filename, lineno, offset, text, end_lineno, end_offset),
)
if sys.version_info >= (3, 10):
super().__init__(
msg, (filename, lineno, offset, text, end_lineno, end_offset),
)
else:
self.end_lineno: int = end_lineno
self.end_offset: int = end_offset
super().__init__(msg, (filename, lineno, offset, text))

self.colno: int = colno
self.end_colno: int = end_colno

Expand Down

0 comments on commit 6210975

Please sign in to comment.