summaryrefslogtreecommitdiff
path: root/docker/utils/fnmatch.py
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2017-03-28 16:58:51 -0700
committerJoffrey F <joffrey@docker.com>2017-03-29 15:39:48 -0700
commit73d8097b3d63dcc0aba41cef3f7bdcf0459ae8ee (patch)
tree9631674f3a907f36704a1860c341346fada3941c /docker/utils/fnmatch.py
parent7fa30a713e328e007c982e0e1bf113a2f81ef1ba (diff)
downloaddocker-py-appveyor.tar.gz
Fix test issuesappveyor
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/utils/fnmatch.py')
-rw-r--r--docker/utils/fnmatch.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/docker/utils/fnmatch.py b/docker/utils/fnmatch.py
index 80bdf77..e95b63c 100644
--- a/docker/utils/fnmatch.py
+++ b/docker/utils/fnmatch.py
@@ -39,15 +39,13 @@ def fnmatch(name, pat):
If you don't want this, use fnmatchcase(FILENAME, PATTERN).
"""
- import os
- name = os.path.normcase(name)
- pat = os.path.normcase(pat)
+ name = name.lower()
+ pat = pat.lower()
return fnmatchcase(name, pat)
def fnmatchcase(name, pat):
"""Test whether FILENAME matches PATTERN, including case.
-
This is a version of fnmatch() which doesn't case-normalize
its arguments.
"""
@@ -67,7 +65,6 @@ def translate(pat):
There is no way to quote meta-characters.
"""
-
recursive_mode = False
i, n = 0, len(pat)
res = ''
@@ -100,7 +97,7 @@ def translate(pat):
stuff = '\\' + stuff
res = '%s[%s]' % (res, stuff)
elif recursive_mode and c == '/':
- res = res + '/?'
+ res = res + re.escape(c) + '?'
else:
res = res + re.escape(c)
return res + '\Z(?ms)'