msc_info in get_version

This commit is contained in:
Jeong YunWon committed 2025-12-23 23:28:58 +09:00
1 parent fc0a34a5a5
commit 286a5b5b8f
2 files changed
+19 -2

No files matched your search

+1 -1
View File
@@ -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'
+18 -1
View File
@@ -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,
)
}