File tree 2 files changed +10
-5
lines changed 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -1554,8 +1554,6 @@ def test_returns_pid(self):
1554
1554
with open (pidfile ) as f :
1555
1555
self .assertEqual (f .read (), str (pid ))
1556
1556
1557
- # TODO: RUSTPYTHON: AssertionError: None != 'no_such_executable'
1558
- @unittest .expectedFailure
1559
1557
def test_no_such_executable (self ):
1560
1558
no_such_executable = 'no_such_executable'
1561
1559
try :
Original file line number Diff line number Diff line change @@ -1278,7 +1278,10 @@ pub mod module {
1278
1278
fn spawn ( self , spawnp : bool , vm : & VirtualMachine ) -> PyResult < libc:: pid_t > {
1279
1279
use crate :: TryFromBorrowedObject ;
1280
1280
1281
- let path = CString :: new ( self . path . into_bytes ( ) )
1281
+ let path = self
1282
+ . path
1283
+ . clone ( )
1284
+ . into_cstring ( vm)
1282
1285
. map_err ( |_| vm. new_value_error ( "path should not have nul bytes" . to_owned ( ) ) ) ?;
1283
1286
1284
1287
let mut file_actions = unsafe {
@@ -1331,7 +1334,9 @@ pub mod module {
1331
1334
}
1332
1335
} ;
1333
1336
if ret != 0 {
1334
- return Err ( errno_err ( vm) ) ;
1337
+ return Err ( IOErrorBuilder :: new ( std:: io:: Error :: from_raw_os_error ( ret) )
1338
+ . filename ( self . path )
1339
+ . into_pyexception ( vm) ) ;
1335
1340
}
1336
1341
}
1337
1342
}
@@ -1403,7 +1408,9 @@ pub mod module {
1403
1408
if ret == 0 {
1404
1409
Ok ( pid)
1405
1410
} else {
1406
- Err ( errno_err ( vm) )
1411
+ Err ( IOErrorBuilder :: new ( std:: io:: Error :: from_raw_os_error ( ret) )
1412
+ . filename ( self . path )
1413
+ . into_pyexception ( vm) )
1407
1414
}
1408
1415
}
1409
1416
}
You can’t perform that action at this time.
0 commit comments