Skip to content

Commit 9c6893b

Browse files
committed
pathlib: Fix glob() to return Path objects rather than strings.
Fix glob() to return Path objects rather than bare strings, same as CPython https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob
1 parent 913498e commit 9c6893b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python-stdlib/pathlib/pathlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _glob(self, path, pattern, recursive):
126126
for name, mode, *_ in os.ilistdir(path):
127127
full_path = path + _SEP + name
128128
if name.startswith(prefix) and name.endswith(suffix):
129-
yield full_path
129+
yield Path(full_path)
130130
if recursive and mode & 0x4000: # is_dir
131131
yield from self._glob(full_path, pattern, recursive=recursive)
132132

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy