mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 21:01:10 +00:00
Update python_util.rs
This commit is contained in:
parent
492d94959b
commit
8b6e502034
1 changed files with 1 additions and 0 deletions
|
@ -32,6 +32,7 @@ pub fn detect_magic_number() -> u32 {
|
||||||
.arg("import importlib.util as util;print(util.MAGIC_NUMBER.hex())")
|
.arg("import importlib.util as util;print(util.MAGIC_NUMBER.hex())")
|
||||||
.output()
|
.output()
|
||||||
.expect("cannot get the magic number from python");
|
.expect("cannot get the magic number from python");
|
||||||
|
dbg!(&out);
|
||||||
let s_hex_magic_num = String::from_utf8(out.stdout).unwrap();
|
let s_hex_magic_num = String::from_utf8(out.stdout).unwrap();
|
||||||
let first_byte = u8::from_str_radix(&s_hex_magic_num[0..=1], 16).unwrap();
|
let first_byte = u8::from_str_radix(&s_hex_magic_num[0..=1], 16).unwrap();
|
||||||
let second_byte = u8::from_str_radix(&s_hex_magic_num[2..=3], 16).unwrap();
|
let second_byte = u8::from_str_radix(&s_hex_magic_num[2..=3], 16).unwrap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue