python3.11支持

This commit is contained in:
xunbu
2025-09-07 09:15:01 +08:00
parent 9dd495a65f
commit 22934bf501
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" __version__="1.4.2.post1"

View File

@@ -89,7 +89,7 @@ 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,
json_string, json_string,
re.MULTILINE re.MULTILINE