Changeset 3692 in products for quintagroup.captcha.core


Ignore:
Timestamp:
Jul 3, 2013 11:58:01 AM (11 years ago)
Author:
potar
Message:

add Python 2.4 support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.captcha.core/trunk/quintagroup/captcha/core/utils.py

    r3689 r3692  
    3434 
    3535 
    36 # BBB: Python 2.4 support 
    37 def any(iterable): 
    38     for element in iterable: 
    39         if element: 
    40             return True 
    41     return False 
     36try: 
     37    # introduced in Python 2.5 
     38    from __builtin__ import any 
     39except ImportError: 
     40    # BBB: Python 2.4 support 
     41    def any(iterable): 
     42        for element in iterable: 
     43            if element: 
     44                return True 
     45        return False 
    4246 
    4347 
Note: See TracChangeset for help on using the changeset viewer.