This commit is contained in:
Pierre Sassoulas 2024-06-20 11:32:36 -03:00 committed by GitHub
commit 9c585bdec3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -137,7 +137,7 @@ class NeverRaised(Exception):
class Visitor:
def __init__(self, fil, rec, ignore, bf, sort):
if isinstance(fil, str):
if isinstance(fil, (str, bytes)):
fil = FNMatcher(fil)
if isinstance(rec, str):
self.rec: Callable[[LocalPath], bool] = FNMatcher(rec)

View File

@ -207,7 +207,7 @@ class CommonFSTests:
@pytest.mark.parametrize(
"fil",
["*dir", "*dir", pytest.mark.skip("sys.version_info < (3,6)")(b"*dir")],
["*dir", "*dir", pytest.mark.skipif("sys.version_info < (3,10)")(b"*dir")],
)
def test_visit_filterfunc_is_string(self, path1, fil):
lst = []
@ -461,12 +461,10 @@ class CommonFSTests:
assert fspath(path1) == path1.strpath
@pytest.mark.skip("sys.version_info < (3,6)")
def test_fspath_open(self, path1):
f = path1.join("opentestfile")
open(f)
@pytest.mark.skip("sys.version_info < (3,6)")
def test_fspath_fsencode(self, path1):
from os import fsencode