mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 20:34:44 +00:00
Update python_util.rs
This commit is contained in:
parent
8b6e502034
commit
a5a405b918
1 changed files with 2 additions and 3 deletions
|
@ -25,11 +25,10 @@ pub fn which_python() -> String {
|
|||
pub fn detect_magic_number() -> u32 {
|
||||
let command = if cfg!(windows) { "cmd" } else { "sh" };
|
||||
let arg = if cfg!(windows) { "/C" } else { "-c" };
|
||||
let python_command = format!("{} -c \"import importlib.util as util;print(util.MAGIC_NUMBER.hex())\"", which_python());
|
||||
let out = Command::new(command)
|
||||
.arg(arg)
|
||||
.arg(which_python())
|
||||
.arg("-c")
|
||||
.arg("import importlib.util as util;print(util.MAGIC_NUMBER.hex())")
|
||||
.arg(python_command)
|
||||
.output()
|
||||
.expect("cannot get the magic number from python");
|
||||
dbg!(&out);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue