fix(bindings): properly detect MSVC compiler

This commit is contained in:
ObserverOfTime 2025-08-28 20:49:34 +03:00
parent c12b4a1565
commit 0be215e152
2 changed files with 27 additions and 31 deletions

View file

@ -689,15 +689,10 @@ pub fn generate_grammar_files(
allow_update,
|path| generate_file(path, SETUP_PY_TEMPLATE, language_name, &generate_opts),
|path| {
let mut contents = fs::read_to_string(path)?;
if !contents.contains("egg_info") || !contents.contains("Py_GIL_DISABLED") {
let contents = fs::read_to_string(path)?;
if !contents.contains("build_ext") {
eprintln!("Replacing setup.py");
generate_file(path, SETUP_PY_TEMPLATE, language_name, &generate_opts)?;
} else {
contents = contents
.replace("path\nfrom platform import system", "name as os_name, path")
.replace("system() != \"Windows\"", "os_name != \"nt\"");
write_file(path, contents)?;
}
Ok(())
},