File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 55
66dir_path = os .path .dirname (os .path .realpath (__file__ ))
77
8- with assert_raises (ValueError ):
8+ # TODO: RUSTPYTHON. At some point snippets will fail and it will look confusing
9+ # and out of the blue. This is going to be the cause and it's going to happen when
10+ # the github worker for MacOS starts using Python 3.11.4.
11+ if platform .python_implementation == "CPython" and platform .system () == 'Darwin' :
12+ expectedException = ValueError
13+ else :
14+ expectedException = SyntaxError
15+
16+ with assert_raises (expectedException ):
917 with open (os .path .join (dir_path , "non_utf8.txt" )) as f :
1018 eval (f .read ())
Original file line number Diff line number Diff line change @@ -257,7 +257,8 @@ mod builtins {
257257 Either :: A ( either) => {
258258 let source: & [ u8 ] = & either. borrow_bytes ( ) ;
259259 if source. contains ( & 0 ) {
260- return Err ( vm. new_value_error (
260+ return Err ( vm. new_exception_msg (
261+ vm. ctx . exceptions . syntax_error . to_owned ( ) ,
261262 "source code string cannot contain null bytes" . to_owned ( ) ,
262263 ) ) ;
263264 }
You can’t perform that action at this time.
0 commit comments