mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
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:
2 files changed
-38
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user