Skip to content

sys: Fix sys.maxsize and add sys.maxunicode #1124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/snippets/sysmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
assert type(sys.flags).__name__ == "flags"
assert type(sys.flags.optimize) is int
assert sys.flags[3] == sys.flags.optimize
assert sys.maxunicode == 1114111
3 changes: 2 additions & 1 deletion vm/src/sysmodule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ settrace() -- set the global debug tracing function
"getfilesystemencoding" => ctx.new_rustfunc(sys_getfilesystemencoding),
"getfilesystemencodeerrors" => ctx.new_rustfunc(sys_getfilesystemencodeerrors),
"intern" => ctx.new_rustfunc(sys_intern),
"maxsize" => ctx.new_int(std::usize::MAX),
"maxunicode" => ctx.new_int(0x0010_FFFF),
"maxsize" => ctx.new_int(std::isize::MAX),
"path" => path,
"ps1" => ctx.new_str(">>>>> ".to_string()),
"ps2" => ctx.new_str("..... ".to_string()),
Expand Down