Mercurial > babel > mirror
annotate babel/compat.py @ 575:8ce41e60f90d trunk
remove ElementTree import from babel.compat as this introduces a new (unnecessary) dependency for Python 2.4 users
author | fschwarz |
---|---|
date | Tue, 24 Jul 2012 08:20:14 +0000 |
parents | c81a11cb1476 |
children |
rev | line source |
---|---|
567
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
1 # -*- coding: utf-8 -*- |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
2 # |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
3 # Copyright (C) 2007-2011 Edgewall Software |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
4 # All rights reserved. |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
5 # |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
6 # This software is licensed as described in the file COPYING, which |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
7 # you should have received as part of this distribution. The terms |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
8 # are also available at http://babel.edgewall.org/wiki/License. |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
9 # |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
10 # This software consists of voluntary contributions made by many |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
11 # individuals. For the exact contribution history, see the revision |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
12 # history and logs, available at http://babel.edgewall.org/log/. |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
13 |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
14 try: |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
15 any = any |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
16 except NameError: |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
17 def any(iterable): |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
18 return filter(None, list(iterable)) |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
19 |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
20 try: |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
21 import threading |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
22 except ImportError: |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
23 import dummy_threading as threading |
c81a11cb1476
add a compat module to shield the code from changes in different versions of Python
fschwarz
parents:
diff
changeset
|
24 |