chore(theme): astro 锁定 ~5.18.0(终审 Minor)+ docs: Plan 4 收官

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-10-22 16:16:03 +08:00
parent 87d6b9a777
commit e6c8cb9ce6
2657 changed files with 439197 additions and 4 deletions
@@ -0,0 +1,24 @@
from __future__ import annotations
def tracemalloc_message(source: object) -> str:
if source is None:
return ""
try:
import tracemalloc
except ImportError:
return ""
tb = tracemalloc.get_object_traceback(source)
if tb is not None:
formatted_tb = "\n".join(tb.format())
# Use a leading new line to better separate the (large) output
# from the traceback to the previous warning text.
return f"\nObject allocated at:\n{formatted_tb}"
# No need for a leading new line.
url = "https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings"
return (
"Enable tracemalloc to get traceback where the object was allocated.\n"
f"See {url} for more info."
)