mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Enforce zero arguments to locals
This commit is contained in:
1 parent
976a3f7a03
commit
d8cd5a3361
1 file changed
+3
-1
+3
-1
@@ -161,10 +161,12 @@ fn builtin_len(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
|
||||
// builtin_list
|
||||
|
||||
fn builtin_locals(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
|
||||
if args.args.len() != 0 {
|
||||
panic!("locals() doesn't take any arguments");
|
||||
}
|
||||
Ok(vm.get_locals())
|
||||
}
|
||||
|
||||
|
||||
pub fn builtin_print(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
|
||||
trace!("print called with {:?}", args);
|
||||
for a in args.args {
|
||||
|
||||
Reference in new issue
Block a user