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

This brings it more in line with regular glob for which glob('.') = ['.'].
master
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
1 changed files with 6 additions and 0 deletions

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)