summaryrefslogtreecommitdiffstats
path: root/Lib/glob.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/glob.py')
-rw-r--r--Lib/glob.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/Lib/glob.py b/Lib/glob.py
index 6088de0..c506e0e 100644
--- a/Lib/glob.py
+++ b/Lib/glob.py
@@ -523,43 +523,6 @@ class _Globber:
except OSError:
pass
- @classmethod
- def walk(cls, root, top_down, on_error, follow_symlinks):
- """Walk the directory tree from the given root, similar to os.walk().
- """
- paths = [root]
- while paths:
- path = paths.pop()
- if isinstance(path, tuple):
- yield path
- continue
- try:
- with cls.scandir(path) as scandir_it:
- dirnames = []
- filenames = []
- if not top_down:
- paths.append((path, dirnames, filenames))
- for entry in scandir_it:
- name = entry.name
- try:
- if entry.is_dir(follow_symlinks=follow_symlinks):
- if not top_down:
- paths.append(cls.parse_entry(entry))
- dirnames.append(name)
- else:
- filenames.append(name)
- except OSError:
- filenames.append(name)
- except OSError as error:
- if on_error is not None:
- on_error(error)
- else:
- if top_down:
- yield path, dirnames, filenames
- if dirnames:
- prefix = cls.add_slash(path)
- paths += [cls.concat_path(prefix, d) for d in reversed(dirnames)]
-
class _StringGlobber(_Globber):
lstat = staticmethod(os.lstat)