Skip to content

Commit 9261d94

Browse files
Merge pull request RustPython#1124 from corona10/sys_maxunicode
sys: Fix sys.maxsize and add sys.maxunicode
2 parents bdd7fa8 + 2e618af commit 9261d94

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tests/snippets/sysmod.py

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@
2020
assert type(sys.flags).__name__ == "flags"
2121
assert type(sys.flags.optimize) is int
2222
assert sys.flags[3] == sys.flags.optimize
23+
assert sys.maxunicode == 1114111

vm/src/sysmodule.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ settrace() -- set the global debug tracing function
256256
"getfilesystemencoding" => ctx.new_rustfunc(sys_getfilesystemencoding),
257257
"getfilesystemencodeerrors" => ctx.new_rustfunc(sys_getfilesystemencodeerrors),
258258
"intern" => ctx.new_rustfunc(sys_intern),
259-
"maxsize" => ctx.new_int(std::usize::MAX),
259+
"maxunicode" => ctx.new_int(0x0010_FFFF),
260+
"maxsize" => ctx.new_int(std::isize::MAX),
260261
"path" => path,
261262
"ps1" => ctx.new_str(">>>>> ".to_string()),
262263
"ps2" => ctx.new_str("..... ".to_string()),

0 commit comments

Comments
 (0)