From 0342e6cccd2616dc05652cd915fd49f85c5b942e Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Sun, 2 Aug 2026 09:42:14 -0400 Subject: [PATCH] Format Prefab import guard --- fastmcp_slim/fastmcp/utilities/prefab.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fastmcp_slim/fastmcp/utilities/prefab.py b/fastmcp_slim/fastmcp/utilities/prefab.py index 5d382fffa..805a5fede 100644 --- a/fastmcp_slim/fastmcp/utilities/prefab.py +++ b/fastmcp_slim/fastmcp/utilities/prefab.py @@ -32,8 +32,10 @@ def _could_be_prefab(value_or_type: Any) -> bool: value_or_type if isinstance(value_or_type, type) else type(value_or_type) ) module = getattr(candidate_type, "__module__", "") - return "prefab_ui" in sys.modules or module == "prefab_ui" or module.startswith( - "prefab_ui." + return ( + "prefab_ui" in sys.modules + or module == "prefab_ui" + or module.startswith("prefab_ui.") )