+
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/sycamore/sycamore/utils/extract_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
def extract_json(payload: str) -> Any:
"""Given the provided payload, extract the JSON block from it."""

# Replace Python's None with JSON's null, being careful to not replace
# strings that might contain "None" as part of their content
payload = re.sub(r":\s*None\b", ": null", payload)

try:
return json.loads(payload)
except (ValueError, TypeError, JSONDecodeError) as exc:
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载