Skip to content

Commit 8dbf7b2

Browse files
ilp-sysDimitrisJim
andauthored
Fix test_path_like_objects (RustPython#4773)
Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
1 parent 2b4f607 commit 8dbf7b2

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

Lib/test/test_compile.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,6 @@ def check_different_constants(const1, const2):
757757
self.assertTrue(f1(0))
758758
self.assertTrue(f2(0.0))
759759

760-
# TODO: RUSTPYTHON
761-
@unittest.expectedFailure
762760
def test_path_like_objects(self):
763761
# An implicit test for PyUnicode_FSDecoder().
764762
compile("42", FakePath("test_compile_pathlike"), "single")

Lib/test/test_runpy.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,6 @@ def test_basic_script(self):
656656
self._check_script(script_name, "<run_path>", script_name,
657657
script_name, expect_spec=False)
658658

659-
# TODO: RUSTPYTHON
660-
@unittest.expectedFailure
661659
def test_basic_script_with_path_object(self):
662660
with temp_dir() as script_dir:
663661
mod_name = 'script'

vm/src/stdlib/builtins.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ mod builtins {
2121
convert::ToPyException,
2222
function::{
2323
ArgBytesLike, ArgCallable, ArgIndex, ArgIntoBool, ArgIterable, ArgMapping,
24-
ArgStrOrBytesLike, Either, FuncArgs, KwArgs, OptionalArg, OptionalOption, PosArgs,
24+
ArgStrOrBytesLike, Either, FsPath, FuncArgs, KwArgs, OptionalArg, OptionalOption,
25+
PosArgs,
2526
},
2627
protocol::{PyIter, PyIterReturn},
2728
py_io,
@@ -97,7 +98,7 @@ mod builtins {
9798
#[allow(dead_code)]
9899
struct CompileArgs {
99100
source: PyObjectRef,
100-
filename: PyStrRef,
101+
filename: FsPath,
101102
mode: PyStrRef,
102103
#[pyarg(any, optional)]
103104
flags: OptionalArg<PyIntRef>,

vm/src/stdlib/os.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::{
55
function::{ArgumentError, FromArgs, FsPath, FuncArgs},
66
AsObject, Py, PyObjectRef, PyPayload, PyResult, TryFromObject, VirtualMachine,
77
};
8+
89
use std::{
910
ffi, fs, io,
1011
path::{Path, PathBuf},

0 commit comments

Comments
 (0)