forked from Rust-related/RustPython
Merge pull request #1343 from vazrupe/add-framework-attr
Add framework attribute in sys module
This commit is contained in:
@@ -6,6 +6,9 @@ assert sys.argv[0].endswith('.py')
|
||||
|
||||
assert sys.platform == "linux" or sys.platform == "darwin" or sys.platform == "win32" or sys.platform == "unknown"
|
||||
|
||||
if hasattr(sys, "_framework"):
|
||||
assert type(sys._framework) is str
|
||||
|
||||
assert isinstance(sys.builtin_module_names, tuple)
|
||||
assert 'sys' in sys.builtin_module_names
|
||||
|
||||
|
||||
@@ -225,6 +225,8 @@ pub fn make_module(vm: &VirtualMachine, module: PyObjectRef, builtins: PyObjectR
|
||||
"unknown".to_string()
|
||||
};
|
||||
|
||||
let framework = "".to_string();
|
||||
|
||||
// https://doc.rust-lang.org/reference/conditional-compilation.html#target_endian
|
||||
let bytorder = if cfg!(target_endian = "little") {
|
||||
"little".to_string()
|
||||
@@ -347,6 +349,7 @@ settrace() -- set the global debug tracing function
|
||||
"modules" => modules.clone(),
|
||||
"warnoptions" => ctx.new_list(vec![]),
|
||||
"platform" => ctx.new_str(platform),
|
||||
"_framework" => ctx.new_str(framework),
|
||||
"meta_path" => ctx.new_list(vec![]),
|
||||
"path_hooks" => ctx.new_list(vec![]),
|
||||
"path_importer_cache" => ctx.new_dict(),
|
||||
|
||||
Reference in New Issue
Block a user