File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -141,8 +141,6 @@ def test_getcwd_long_path(self):
141
141
if support .verbose :
142
142
print (f"Tested current directory length: { len (cwd )} " )
143
143
144
- # TODO: RUSTPYTHON (AttributeError: module 'os' has no attribute 'getcwdb')
145
- @unittest .expectedFailure
146
144
def test_getcwdb (self ):
147
145
cwd = os .getcwdb ()
148
146
self .assertIsInstance (cwd , bytes )
Original file line number Diff line number Diff line change @@ -682,6 +682,11 @@ mod _os {
682
682
. to_owned ( ) )
683
683
}
684
684
685
+ #[ pyfunction]
686
+ fn getcwdb ( vm : & VirtualMachine ) -> PyResult < Vec < u8 > > {
687
+ Ok ( getcwd ( vm) ?. into_bytes ( ) . to_vec ( ) )
688
+ }
689
+
685
690
#[ pyfunction]
686
691
fn chdir ( path : PyPathLike , vm : & VirtualMachine ) -> PyResult < ( ) > {
687
692
env:: set_current_dir ( & path. path ) . map_err ( |err| err. into_pyexception ( vm) )
You can’t perform that action at this time.
0 commit comments