refactor(build-backend): simplify removal of Python bytecode artifacts by directly unlinking files without sibling check

This commit is contained in:
Ivan
2026-04-07 15:47:55 -05:00
parent e848f32d4f
commit d03f32df1a
+1 -5
View File
@@ -30,11 +30,7 @@ function stripPythonBytecodeArtifacts(dir) {
stripPythonBytecodeArtifacts(full);
}
} else if (ent.name.endsWith(".pyc") || ent.name.endsWith(".pyo")) {
const stem = ent.name.replace(/\.pyc$/i, "").replace(/\.pyo$/i, "");
const siblingPy = path.join(dir, `${stem}.py`);
if (fs.existsSync(siblingPy)) {
fs.unlinkSync(full);
}
fs.unlinkSync(full);
}
}
}