From a0eb78c8117dccefacc393f3e10d34f8c10749c6 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Mon, 19 Apr 2010 03:03:25 +0000 Subject: Remove compat fnmatch.filter() support. --- src/engine/SCons/compat/__init__.py | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/engine/SCons/compat/__init__.py b/src/engine/SCons/compat/__init__.py index 62c6467..1318bf5 100644 --- a/src/engine/SCons/compat/__init__.py +++ b/src/engine/SCons/compat/__init__.py @@ -152,34 +152,6 @@ except AttributeError: del whichdb -import fnmatch -try: - fnmatch.filter -except AttributeError: - # Pre-2.2 Python has no fnmatch.filter() function. - def filter(names, pat): - """Return the subset of the list NAMES that match PAT""" - import os,posixpath - result=[] - pat = os.path.normcase(pat) - if pat not in fnmatch._cache: - import re - res = fnmatch.translate(pat) - fnmatch._cache[pat] = re.compile(res) - match = fnmatch._cache[pat].match - if os.path is posixpath: - # normcase on posix is NOP. Optimize it away from the loop. - for name in names: - if match(name): - result.append(name) - else: - for name in names: - if match(os.path.normcase(name)): - result.append(name) - return result - fnmatch.filter = filter - del filter - try: import io except ImportError: -- cgit v0.12