Fixup for bug 559964 to make the hook work with python 2.4
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 03 May 2011 07:59:54 +0200
changeset 62 01042c8ddb206f980aa940dc27d4e55377fd8932
parent 61 2b48ff549ea95e71dc627eb6c8e49bbb31c73705
child 63 03a94fa376e35ee9b92197089361a3a9735bbc49
push id27
push usermh@glandium.org
push dateTue, 03 May 2011 06:04:36 +0000
bugs559964
Fixup for bug 559964 to make the hook work with python 2.4
mozhghooks/try_gcc45.py
--- a/mozhghooks/try_gcc45.py
+++ b/mozhghooks/try_gcc45.py
@@ -55,16 +55,22 @@ def TryParser(message):
                         help='provide a list of talos tests, or specify all (default is None)')
 
     (options, unknown_args) = parser.parse_known_args(processMessage(message))
 
     options.user_platforms = options.user_platforms.split(',')
 
     return options
 
+def any(iterable):
+    for element in iterable:
+        if element:
+            return True
+    return False
+
 def hook(ui, repo, **kwargs):
     name = os.path.basename(repo.root)
     if name != "try":
         return 0;
 
     options = TryParser(repo.changectx('tip').description())
     if options.do_everything or any(p in options.user_platforms for p in ['all', 'linux', 'linux64']):
         try: