Skip to content

Commit 6d5f4bd

Browse files
author
Wenjie Yang
committed
Remove arg_check! in tokenize
1 parent ad111b0 commit 6d5f4bd

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

vm/src/stdlib/tokenize.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ use std::iter::FromIterator;
66

77
use rustpython_parser::lexer;
88

9-
use crate::function::PyFuncArgs;
10-
use crate::obj::objstr;
9+
use crate::obj::objstr::PyStringRef;
1110
use crate::pyobject::{PyObjectRef, PyResult};
1211
use crate::vm::VirtualMachine;
1312

14-
fn tokenize_tokenize(vm: &VirtualMachine, args: PyFuncArgs) -> PyResult {
15-
arg_check!(vm, args, required = [(readline, Some(vm.ctx.str_type()))]);
16-
let source = objstr::borrow_value(readline);
13+
fn tokenize_tokenize(s: PyStringRef, vm: &VirtualMachine) -> PyResult {
14+
let source = s.as_str();
1715

1816
// TODO: implement generator when the time has come.
1917
let lexer1 = lexer::make_tokenizer(source);

0 commit comments

Comments
 (0)