We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 639e42e commit bdb11d0Copy full SHA for bdb11d0
codeflash/code_utils/code_extractor.py
@@ -331,7 +331,9 @@ def add_needed_imports_from_module(
331
RemoveImportsVisitor.remove_unused_import(dst_context, mod)
332
for mod, obj_seq in gatherer.object_mapping.items():
333
for obj in obj_seq:
334
- if f"{mod}.{obj}" in helper_functions_fqn:
+ if (
335
+ f"{mod}.{obj}" in helper_functions_fqn or dst_context.full_module_name is mod
336
+ ): # avoid circular imports
337
continue # Skip adding imports for helper functions already in the context
338
AddImportsVisitor.add_needed_import(dst_context, mod, obj)
339
RemoveImportsVisitor.remove_unused_import(dst_context, mod, obj)
0 commit comments