Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add sys.winver
  • Loading branch information
dalinaum committed Mar 6, 2023
commit 5adae77e393fee0b537a8c93302d62b744753729
7 changes: 7 additions & 0 deletions vm/src/stdlib/sys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,13 @@ mod sys {
version::get_version()
}

#[cfg(windows)]
#[pyattr]
fn winver(_vm: &VirtualMachine) -> String {
// Note: This is Python DLL version in CPython, but we arbitrary fill it for compatibility
version::get_winver_number()
Comment thread
youknowone marked this conversation as resolved.
}

#[pyattr]
fn _xoptions(vm: &VirtualMachine) -> PyDictRef {
let ctx = &vm.ctx;
Expand Down
4 changes: 4 additions & 0 deletions vm/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ pub fn get_version_number() -> String {
format!("{MAJOR}.{MINOR}.{MICRO}{RELEASELEVEL}")
}

pub fn get_winver_number() -> String {
format!("{MAJOR}.{MINOR}")
}

pub fn get_compiler() -> String {
format!("rustc {}", env!("RUSTC_VERSION"))
}
Expand Down