1
- use crate :: function:: PyFuncArgs ;
2
- use crate :: pyobject:: { PyObjectRef , PyResult } ;
1
+ use crate :: pyobject:: PyObjectRef ;
3
2
use crate :: version;
4
3
use crate :: vm:: VirtualMachine ;
5
4
@@ -15,36 +14,26 @@ pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
15
14
} )
16
15
}
17
16
18
- fn platform_python_implementation ( vm : & VirtualMachine , args : PyFuncArgs ) -> PyResult {
19
- arg_check ! ( vm, args) ;
20
- Ok ( vm. new_str ( "RustPython" . to_string ( ) ) )
17
+ fn platform_python_implementation ( _vm : & VirtualMachine ) -> String {
18
+ "RustPython" . to_string ( )
21
19
}
22
20
23
- fn platform_python_version ( vm : & VirtualMachine , args : PyFuncArgs ) -> PyResult {
24
- arg_check ! ( vm, args) ;
25
- Ok ( vm. new_str ( version:: get_version_number ( ) ) )
21
+ fn platform_python_version ( _vm : & VirtualMachine ) -> String {
22
+ version:: get_version_number ( )
26
23
}
27
24
28
- fn platform_python_compiler ( vm : & VirtualMachine , args : PyFuncArgs ) -> PyResult {
29
- arg_check ! ( vm, args) ;
30
- Ok ( vm. new_str ( version:: get_compiler ( ) ) )
25
+ fn platform_python_compiler ( _vm : & VirtualMachine ) -> String {
26
+ version:: get_compiler ( )
31
27
}
32
28
33
- fn platform_python_build ( vm : & VirtualMachine , args : PyFuncArgs ) -> PyResult {
34
- arg_check ! ( vm, args) ;
35
- let git_hash = version:: get_git_identifier ( ) ;
36
- let git_timestamp = version:: get_git_datetime ( ) ;
37
- Ok ( vm
38
- . ctx
39
- . new_tuple ( vec ! [ vm. new_str( git_hash) , vm. new_str( git_timestamp) ] ) )
29
+ fn platform_python_build ( _vm : & VirtualMachine ) -> ( String , String ) {
30
+ ( version:: get_git_identifier ( ) , version:: get_git_datetime ( ) )
40
31
}
41
32
42
- fn platform_python_branch ( vm : & VirtualMachine , args : PyFuncArgs ) -> PyResult {
43
- arg_check ! ( vm, args) ;
44
- Ok ( vm. new_str ( version:: get_git_branch ( ) ) )
33
+ fn platform_python_branch ( _vm : & VirtualMachine ) -> String {
34
+ version:: get_git_branch ( )
45
35
}
46
36
47
- fn platform_python_revision ( vm : & VirtualMachine , args : PyFuncArgs ) -> PyResult {
48
- arg_check ! ( vm, args) ;
49
- Ok ( vm. new_str ( version:: get_git_revision ( ) ) )
37
+ fn platform_python_revision ( _vm : & VirtualMachine ) -> String {
38
+ version:: get_git_revision ( )
50
39
}
0 commit comments