File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,13 +261,12 @@ mod termios {
261261 }
262262
263263 fn termios_error ( err : std:: io:: Error , vm : & VirtualMachine ) -> PyBaseExceptionRef {
264- vm. new_exception (
264+ vm. new_os_subtype_error (
265265 error_type ( vm) ,
266- vec ! [
267- err. posix_errno( ) . to_pyobject( vm) ,
268- vm. ctx. new_str( err. to_string( ) ) . into( ) ,
269- ] ,
266+ Some ( err. posix_errno ( ) ) ,
267+ vm. ctx . new_str ( err. to_string ( ) ) ,
270268 )
269+ . upcast ( )
271270 }
272271
273272 #[ pyattr( name = "error" , once) ]
Original file line number Diff line number Diff line change @@ -1278,9 +1278,9 @@ pub(super) mod _os {
12781278 {
12791279 use std:: os:: unix:: ffi:: OsStrExt ;
12801280 let src_cstr = std:: ffi:: CString :: new ( src. path . as_os_str ( ) . as_bytes ( ) )
1281- . map_err ( |_| vm. new_value_error ( "embedded null byte" . to_owned ( ) ) ) ?;
1281+ . map_err ( |_| vm. new_value_error ( "embedded null byte" ) ) ?;
12821282 let dst_cstr = std:: ffi:: CString :: new ( dst. path . as_os_str ( ) . as_bytes ( ) )
1283- . map_err ( |_| vm. new_value_error ( "embedded null byte" . to_owned ( ) ) ) ?;
1283+ . map_err ( |_| vm. new_value_error ( "embedded null byte" ) ) ?;
12841284
12851285 let flags = if follow_symlinks. 0 {
12861286 libc:: AT_SYMLINK_FOLLOW
@@ -1315,7 +1315,7 @@ pub(super) mod _os {
13151315 // or raise NotImplementedError if explicitly set to False
13161316 if !follow_symlinks. 0 {
13171317 return Err ( vm. new_not_implemented_error (
1318- "link: follow_symlinks unavailable on this platform" . to_owned ( ) ,
1318+ "link: follow_symlinks unavailable on this platform" ,
13191319 ) ) ;
13201320 }
13211321
You can’t perform that action at this time.
0 commit comments