Update pathlib.py Path.glob()

Fix glob() to return Path objects rather than bare strings, same as CPython
https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob

Signed-off-by: RotatingLlama <137008229+RotatingLlama@users.noreply.github.com>
pull/1027/head
RotatingLlama 2025-06-29 20:19:13 +01:00 zatwierdzone przez GitHub
rodzic 913498ef05
commit 4d682b3fc8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -126,7 +126,7 @@ class Path:
for name, mode, *_ in os.ilistdir(path):
full_path = path + _SEP + name
if name.startswith(prefix) and name.endswith(suffix):
yield full_path
yield Path(full_path)
if recursive and mode & 0x4000: # is_dir
yield from self._glob(full_path, pattern, recursive=recursive)