[cig-commits] r18448 - cs/buildbot/trunk/buildbot/scripts

brad at geodynamics.org brad at geodynamics.org
Tue May 24 11:41:17 PDT 2011


Author: brad
Date: 2011-05-24 11:41:17 -0700 (Tue, 24 May 2011)
New Revision: 18448

Modified:
   cs/buildbot/trunk/buildbot/scripts/packager.py
Log:
Make filtering package list work on python versions >= 2.3.

Modified: cs/buildbot/trunk/buildbot/scripts/packager.py
===================================================================
--- cs/buildbot/trunk/buildbot/scripts/packager.py	2011-05-23 21:18:50 UTC (rev 18447)
+++ cs/buildbot/trunk/buildbot/scripts/packager.py	2011-05-24 18:41:17 UTC (rev 18448)
@@ -18,12 +18,18 @@
 
 
 def filterList(l, excludes):
-    import re, functools, operator
+    try:
+        import re, functools, operator
 
-    pats = [re.compile(ex) for ex in excludes]
-    return [i for i in l if not functools.reduce(operator.or_, [bool(pat.match(i)) for pat in pats])]
+        pats = [re.compile(ex) for ex in excludes]
+        return [i for i in l if not functools.reduce(operator.or_, [bool(pat.match(i)) for pat in pats])]
+    except (ImportError, AttributeError):
+        import re, operator
 
+        pats = [re.compile(ex) for ex in excludes]
+        return [i for i in l if not reduce(operator.or_, [bool(pat.match(i)) for pat in pats])]
 
+
 class PackingList(object):
     def __init__(self, config, opSys, python):
         



More information about the CIG-COMMITS mailing list