mirror of
https://github.com/codeflash-ai/codeflash.git
synced 2026-05-04 18:25:17 +00:00
fix: resolve mypy "Name _ already defined" error in registry.py
Replace three `from X import support as _` patterns with a loop using `importlib.import_module()`, eliminating the duplicate name binding. Co-authored-by: Kevin Turcios <KRRT7@users.noreply.github.com>
This commit is contained in:
parent
8dc6d9eeda
commit
8f571ccd0f
1 changed files with 8 additions and 8 deletions
|
|
@ -48,15 +48,15 @@ def _ensure_languages_registered() -> None:
|
|||
# Import support modules to trigger registration
|
||||
# These imports are deferred to avoid circular imports
|
||||
import contextlib
|
||||
import importlib
|
||||
|
||||
with contextlib.suppress(ImportError):
|
||||
from codeflash.languages.python import support as _
|
||||
|
||||
with contextlib.suppress(ImportError):
|
||||
from codeflash.languages.javascript import support as _
|
||||
|
||||
with contextlib.suppress(ImportError):
|
||||
from codeflash.languages.java import support as _ # noqa: F401
|
||||
for _lang_module in (
|
||||
"codeflash.languages.python.support",
|
||||
"codeflash.languages.javascript.support",
|
||||
"codeflash.languages.java.support",
|
||||
):
|
||||
with contextlib.suppress(ImportError):
|
||||
importlib.import_module(_lang_module)
|
||||
|
||||
_languages_registered = True
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue