diff options
author | Guido van Rossum <guido@python.org> | 1992-01-01 19:35:13 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-01-01 19:35:13 (GMT) |
commit | bdfcfccbe591e15221f35add01132174c9b4e669 (patch) | |
tree | 7e5f0d52b8c44e623b12e8f4b5cd645c361e5aeb /Lib/glob.py | |
parent | 4d8e859e8f0a209a7e999ce9cc0988156c795949 (diff) | |
download | cpython-bdfcfccbe591e15221f35add01132174c9b4e669.zip cpython-bdfcfccbe591e15221f35add01132174c9b4e669.tar.gz cpython-bdfcfccbe591e15221f35add01132174c9b4e669.tar.bz2 |
New == syntax
Diffstat (limited to 'Lib/glob.py')
-rw-r--r-- | Lib/glob.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/glob.py b/Lib/glob.py index e29095c..4c7e084 100644 --- a/Lib/glob.py +++ b/Lib/glob.py @@ -7,7 +7,7 @@ import fnmatch def glob(pathname): if not has_magic(pathname): return [pathname] dirname, basename = path.split(pathname) - if dirname[-1:] = '/' and dirname <> '/': + if dirname[-1:] == '/' and dirname <> '/': dirname = dirname[:-1] if has_magic(dirname): list = glob(dirname) @@ -34,9 +34,10 @@ def glob1(dirname, pattern): names = posix.listdir(dirname) except posix.error: return [] + names.sort() result = [] for name in names: - if name[0] <> '.' or pattern[0] = '.': + if name[0] <> '.' or pattern[0] == '.': if fnmatch.fnmatch(name, pattern): result.append(name) return result |