summaryrefslogtreecommitdiff
path: root/compat.py
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2010-09-13 15:09:57 +0200
committerEmile Anclin <emile.anclin@logilab.fr>2010-09-13 15:09:57 +0200
commit4ef71160c871b225078917c17f4393146838ee4b (patch)
tree4293b6ed7c0ed85aaf774d170fb045293f1a1c68 /compat.py
parent215170f7b48fe1ad685d2c8785b4f47152ddbd15 (diff)
downloadlogilab-common-4ef71160c871b225078917c17f4393146838ee4b.tar.gz
[py3k] add callable to compat.py
import "callable" where needed. We can't use collections in python <= 2.5
Diffstat (limited to 'compat.py')
-rw-r--r--compat.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/compat.py b/compat.py
index c9c5ff4..c025878 100644
--- a/compat.py
+++ b/compat.py
@@ -31,6 +31,14 @@ from warnings import warn
import __builtin__
try:
+ callable = callable
+except NameError:# callable removed from py3k
+ import collections
+ def callable(something):
+ return isinstance(something, collections.Callable)
+ del collections
+
+try:
set = set
frozenset = frozenset
except NameError: