kopia lustrzana https://github.com/micropython/micropython-lib
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
rodzic
913498ef05
commit
4d682b3fc8
|
@ -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)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue