Skip to content

Commit a7de7ac

Browse files
authored
[mypyc] Derive .c file name from full module name if using multi_file (#19278)
Don't shorten the module name prefixes, so that the names of output files are more predictable. This can help if integrating with build systems, and it arguably also makes it easier to inspect the output manually. Now the file name could be `__native_pkg___mod.c` instead of `__native_mod.c` for the module `pkg.mod`.
1 parent 61cbe0c commit a7de7ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypyc/codegen/emitmodule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ def generate_c_for_modules(self) -> list[tuple[str, str]]:
582582
fn, emitter, self.source_paths[module_name], module_name
583583
)
584584
if multi_file:
585-
name = f"__native_{emitter.names.private_name(module_name)}.c"
585+
name = f"__native_{exported_name(module_name)}.c"
586586
file_contents.append((name, "".join(emitter.fragments)))
587587

588588
# The external header file contains type declarations while

0 commit comments

Comments
 (0)