python3.11支持

This commit is contained in:
xunbu
2025-09-07 09:20:02 +08:00
parent 22934bf501
commit 3385863244
2 changed files with 2 additions and 2 deletions

View File

@@ -1,3 +1,3 @@
# SPDX-FileCopyrightText: 2025 QinHan # SPDX-FileCopyrightText: 2025 QinHan
# SPDX-License-Identifier: MPL-2.0 # SPDX-License-Identifier: MPL-2.0
__version__="1.4.2.post1" __version__="1.4.2.post2"

View File

@@ -87,7 +87,7 @@ list[dict[str, str]], list[tuple[int, int]]]:
def fix_json_string(json_string): def fix_json_string(json_string):
def repl(m:re.Match): def repl(m:re.Match):
return f'{'"' if m.group(1) else ""},\n"{m.group(2)}":{'"' if m.group(3) else ""}' return f"""{'"' if m.group(1) else ""},\n"{m.group(2)}":{'"' if m.group(3) else ""}"""
fixed_json = re.sub( fixed_json = re.sub(
r"""([“”"])?\s*[,]\s*["“”]\s*(\d+)\s*["“”]\s*[:]\s*(["“”])?""", r"""([“”"])?\s*[,]\s*["“”]\s*(\d+)\s*["“”]\s*[:]\s*(["“”])?""",
repl, repl,