Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r1061:b04d553b1ecd
Date: 2012-11-23 19:20 +0100
http://bitbucket.org/cffi/cffi/changeset/b04d553b1ecd/

Log:    Remove the default backend's fallback to ctypes, with comments.

diff --git a/cffi/api.py b/cffi/api.py
--- a/cffi/api.py
+++ b/cffi/api.py
@@ -36,14 +36,13 @@
         """
         from . import cparser, model
         if backend is None:
-            try:
-                import _cffi_backend as backend
-            except ImportError as e:
-                import warnings
-                warnings.warn("import _cffi_backend: %s\n"
-                              "Falling back to the ctypes backend." % (e,))
-                from . import backend_ctypes
-                backend = backend_ctypes.CTypesBackend()
+            # You need PyPy (>= 2.0 beta), or a CPython (>= 2.6) with
+            # _cffi_backend.so compiled.
+            import _cffi_backend as backend
+            # (If you insist you can also try to pass the option
+            # 'backend=backend_ctypes.CTypesBackend()', but don't
+            # rely on it!  It's probably not going to work well.)
+
         self._backend = backend
         self._parser = cparser.Parser()
         self._cached_btypes = {}
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to