Let pathclass.glob('.') return cwd.

This brings it more in line with regular glob for which glob('.') = ['.'].
This commit is contained in:
voussoir 2022-01-19 20:23:05 -08:00
parent 9a0be7eda9
commit 8d258241e7
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -620,6 +620,12 @@ def glob(pattern):
If you want to recurse, consider using spinal.walk with glob_filenames
instead.
'''
if pattern == '.':
return [cwd()]
elif pattern == '..':
return [cwd().parent]
(dirname, pattern) = os.path.split(pattern)
return Path(dirname).glob(pattern)