mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-06 17:52:35 +00:00
fix: remove type: ignore comments that fail on older Python mypy
Use getattr/object.__setattr__ pattern to avoid version-dependent type: ignore comments that cause unused-ignore errors on Python 3.10/3.11. Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -677,11 +677,11 @@ _resolving_refs_local = threading.local()
|
||||
|
||||
def _get_resolving_refs() -> set[str]:
|
||||
"""Return the per-thread resolving-refs set, creating it on first access."""
|
||||
try:
|
||||
return _resolving_refs_local.refs # type: ignore[no-any-return]
|
||||
except AttributeError:
|
||||
_resolving_refs_local.refs = set() # type: ignore[attr-defined]
|
||||
return _resolving_refs_local.refs # type: ignore[no-any-return]
|
||||
refs: set[str] | None = getattr(_resolving_refs_local, "refs", None)
|
||||
if refs is None:
|
||||
refs = set()
|
||||
object.__setattr__(_resolving_refs_local, "refs", refs)
|
||||
return refs
|
||||
|
||||
|
||||
def _safe_replace_refs(json_schema: dict[str, Any]) -> dict[str, Any]:
|
||||
|
||||
Reference in New Issue
Block a user