[pypy-commit] cffi default: Fix Python 3.1 compat (callable)

SimonSapin noreply at buildbot.pypy.org
Thu Dec 27 23:05:08 CET 2012


Author: Simon Sapin <simon.sapin at exyr.org>
Branch: 
Changeset: r1102:caad797a6b3d
Date: 2012-12-27 17:11 +0100
http://bitbucket.org/cffi/cffi/changeset/caad797a6b3d/

Log:	Fix Python 3.1 compat (callable)

diff --git a/cffi/api.py b/cffi/api.py
--- a/cffi/api.py
+++ b/cffi/api.py
@@ -1,5 +1,13 @@
 import types
 
+try:
+    callable
+except NameError:
+    # Python 3.1
+    from collections import Callable
+    callable = lambda x: isinstance(x, Callable)
+
+
 class FFIError(Exception):
     pass
 


More information about the pypy-commit mailing list