Skip to content

Commit 1be7cc6

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

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tests/snippets/sysmod.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

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

9+
if hasattr(sys, "_framework"):
10+
assert type(sys._framework) is str
11+
912
assert isinstance(sys.builtin_module_names, tuple)
1013
assert 'sys' in sys.builtin_module_names
1114

vm/src/sysmodule.rs

Lines changed: 3 additions & 0 deletions
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)