mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
msc_info in get_version
This commit is contained in:
1 parent
fc0a34a5a5
commit
286a5b5b8f
2 files changed
+19
-2
No files matched your search
Vendored
+1
-1
@@ -1080,7 +1080,7 @@ def _sys_version(sys_version=None):
|
||||
match.groups()
|
||||
|
||||
# XXX: RUSTPYTHON support
|
||||
if "rustc" in sys_version:
|
||||
if "RustPython" in sys_version:
|
||||
name = "RustPython"
|
||||
else:
|
||||
name = 'CPython'
|
||||
|
||||
@@ -15,12 +15,29 @@ pub const VERSION_HEX: usize =
|
||||
(MAJOR << 24) | (MINOR << 16) | (MICRO << 8) | (RELEASELEVEL_N << 4) | SERIAL;
|
||||
|
||||
pub fn get_version() -> String {
|
||||
// Windows: include MSC v. for compatibility with ctypes.util.find_library
|
||||
// MSC v.1929 = VS 2019, version 14+ makes find_msvcrt() return None
|
||||
#[cfg(windows)]
|
||||
let msc_info = {
|
||||
let arch = if cfg!(target_pointer_width = "64") {
|
||||
"64 bit (AMD64)"
|
||||
} else {
|
||||
"32 bit (Intel)"
|
||||
};
|
||||
// Include both RustPython identifier and MSC v. for compatibility
|
||||
format!(" MSC v.1929 {arch}",)
|
||||
};
|
||||
|
||||
#[cfg(not(windows))]
|
||||
let msc_info = String::new();
|
||||
|
||||
format!(
|
||||
"{:.80} ({:.80}) \n[RustPython {} with {:.80}]", // \n is PyPy convention
|
||||
"{:.80} ({:.80}) \n[RustPython {} with {:.80}{}]", // \n is PyPy convention
|
||||
get_version_number(),
|
||||
get_build_info(),
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
COMPILER,
|
||||
msc_info,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user