mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Update test_sys.py from 3.13.11 (#6428)
* mark RustPython as free-threaded * Py_GIL_DISABLED * Update `test_sys.py` from 3.13.11 * mark tests --------- Co-authored-by: Jeong YunWon <jeong@youknowone.org>
This commit is contained in:
698
Lib/test/test_sys.py
vendored
698
Lib/test/test_sys.py
vendored
File diff suppressed because it is too large
Load Diff
@@ -53,7 +53,7 @@ mod sys {
|
||||
const RUSTPYTHON_DEBUGBUILD: bool = cfg!(debug_assertions);
|
||||
|
||||
#[pyattr(name = "abiflags")]
|
||||
pub(crate) const ABIFLAGS: &str = "";
|
||||
pub(crate) const ABIFLAGS: &str = "t"; // 't' for free-threaded (no GIL)
|
||||
#[pyattr(name = "api_version")]
|
||||
const API_VERSION: u32 = 0x0; // what C api?
|
||||
#[pyattr(name = "copyright")]
|
||||
@@ -599,6 +599,11 @@ mod sys {
|
||||
// TODO: sys.audit implementation
|
||||
}
|
||||
|
||||
#[pyfunction]
|
||||
const fn _is_gil_enabled() -> bool {
|
||||
false // RustPython has no GIL (like free-threaded Python)
|
||||
}
|
||||
|
||||
#[pyfunction]
|
||||
fn exit(code: OptionalArg<PyObjectRef>, vm: &VirtualMachine) -> PyResult {
|
||||
let code = code.unwrap_or_none(vm);
|
||||
|
||||
@@ -23,6 +23,8 @@ pub(crate) mod _sysconfigdata {
|
||||
"RUST_MULTIARCH" => RUST_MULTIARCH,
|
||||
// enough for tests to stop expecting urandom() to fail after restricting file resources
|
||||
"HAVE_GETRANDOM" => 1,
|
||||
// RustPython has no GIL (like free-threaded Python)
|
||||
"Py_GIL_DISABLED" => 1,
|
||||
// Compiler configuration for native extension builds
|
||||
"CC" => "cc",
|
||||
"CXX" => "c++",
|
||||
|
||||
Reference in New Issue
Block a user