Skip to content

Commit 0fd06a0

Browse files
committed
Add framework attribute in sys module
Fixes #1342
1 parent c973ed8 commit 0fd06a0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

tests/snippets/sysmod.py

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
assert sys.platform == "linux" or sys.platform == "darwin" or sys.platform == "win32" or sys.platform == "unknown"
88

9+
assert sys._framework == ""
10+
911
assert isinstance(sys.builtin_module_names, tuple)
1012
assert 'sys' in sys.builtin_module_names
1113

vm/src/sysmodule.rs

+3
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ pub fn make_module(vm: &VirtualMachine, module: PyObjectRef, builtins: PyObjectR
225225
"unknown".to_string()
226226
};
227227

228+
let framework = "".to_string();
229+
228230
// https://doc.rust-lang.org/reference/conditional-compilation.html#target_endian
229231
let bytorder = if cfg!(target_endian = "little") {
230232
"little".to_string()
@@ -347,6 +349,7 @@ settrace() -- set the global debug tracing function
347349
"modules" => modules.clone(),
348350
"warnoptions" => ctx.new_list(vec![]),
349351
"platform" => ctx.new_str(platform),
352+
"_framework" => ctx.new_str(framework),
350353
"meta_path" => ctx.new_list(vec![]),
351354
"path_hooks" => ctx.new_list(vec![]),
352355
"path_importer_cache" => ctx.new_dict(),

0 commit comments

Comments
 (0)