FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add sys.winver by dalinaum · Pull Request #4646 · RustPython/RustPython · GitHub

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

Filter by extension

Filter by extension .rs  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 7 additions & 0 deletions vm/src/stdlib/sys.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL