mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Fix builtins.__name__
This commit is contained in:
1 parent
8a967e84c6
commit
8bfff805a9
2 files changed
+4
-2
No files matched your search
@@ -5,6 +5,10 @@ assert '__builtins__' in globals()
|
||||
with assert_raises(AttributeError):
|
||||
__builtins__.__builtins__
|
||||
|
||||
assert __builtins__.__name__ == "builtins"
|
||||
import builtins
|
||||
assert builtins.__name__ == "builtins"
|
||||
|
||||
__builtins__.x = 'new'
|
||||
assert x == 'new' # noqa: F821
|
||||
|
||||
|
||||
@@ -894,8 +894,6 @@ pub fn make_module(vm: &VirtualMachine, module: PyObjectRef) {
|
||||
let debug_mode: bool = vm.state.settings.optimize == 0;
|
||||
extend_module!(vm, module, {
|
||||
"__debug__" => ctx.new_bool(debug_mode),
|
||||
//set __name__ fixes: https://github.com/RustPython/RustPython/issues/146
|
||||
"__name__" => ctx.new_str(String::from("__main__")),
|
||||
|
||||
"bool" => ctx.types.bool_type.clone(),
|
||||
"bytearray" => ctx.types.bytearray_type.clone(),
|
||||
|
||||
Reference in new issue
Block a user