Skip to content

Commit b3d9e08

Browse files
magicalcookieyouknowone
authored andcommitted
Fix broken module_names in compile_dir for sub-directories
1 parent ba8df41 commit b3d9e08

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

derive/src/compile_bytecode.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ impl CompilationSource {
143143
if path.is_dir() {
144144
code_map.extend(self.compile_dir(
145145
&path,
146-
format!("{}{}", parent, file_name),
146+
if parent.is_empty() {
147+
file_name.to_string()
148+
} else {
149+
format!("{}.{}", parent, file_name)
150+
},
147151
mode,
148152
)?);
149153
} else if file_name.ends_with(".py") {

0 commit comments

Comments
 (0)