Merge pull request #4135 from ecpost/platform-from-rust

Modify the new 3.10.6 version of platform.py to work with platform.rs
This commit is contained in:
Jeong YunWon authored and GitHub committed 2022-09-04 14:14:48 +09:00
commit fe10a4b9df
2 files changed
-38

No files matched your search

-2
View File
@@ -18,7 +18,6 @@ mod json;
mod math;
#[cfg(unix)]
mod mmap;
mod platform;
mod pyexpat;
mod pystruct;
mod random;
@@ -100,7 +99,6 @@ pub fn get_module_inits() -> impl Iterator<Item = (Cow<'static, str>, StdlibInit
"_json" => json::make_module,
"math" => math::make_module,
"pyexpat" => pyexpat::make_module,
"_platform" => platform::make_module,
"_random" => random::make_module,
"_statistics" => statistics::make_module,
"_struct" => pystruct::make_module,
-36
View File
@@ -1,36 +0,0 @@
pub(crate) use decl::make_module;
#[pymodule(name = "platform")]
mod decl {
use crate::vm::{version, VirtualMachine};
#[pyfunction]
fn python_implementation(_vm: &VirtualMachine) -> String {
"RustPython".to_owned()
}
#[pyfunction]
fn python_version(_vm: &VirtualMachine) -> String {
version::get_version_number()
}
#[pyfunction]
fn python_compiler(_vm: &VirtualMachine) -> String {
version::get_compiler()
}
#[pyfunction]
fn python_build(_vm: &VirtualMachine) -> (String, String) {
(version::get_git_identifier(), version::get_git_datetime())
}
#[pyfunction]
fn python_branch(_vm: &VirtualMachine) -> String {
version::get_git_branch()
}
#[pyfunction]
fn python_revision(_vm: &VirtualMachine) -> String {
version::get_git_revision()
}
}