summaryrefslogtreecommitdiff
path: root/Lib/glob.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-01-01 19:35:13 +0000
committerGuido van Rossum <guido@python.org>1992-01-01 19:35:13 +0000
commit9ac216e566fe7f81609722902571ecb799d0d23c (patch)
tree7e5f0d52b8c44e623b12e8f4b5cd645c361e5aeb /Lib/glob.py
parentcfdf58ff71d272899abb9a20d4ee8298571fcb07 (diff)
downloadcpython-9ac216e566fe7f81609722902571ecb799d0d23c.tar.gz
New == syntax
Diffstat (limited to 'Lib/glob.py')
-rw-r--r--Lib/glob.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/glob.py b/Lib/glob.py
index e29095c5ef..4c7e084016 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