mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Enforce zero arguments to locals
This commit is contained in:
@@ -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