Author: Armin Rigo <[email protected]>
Branch:
Changeset: r2613:8a31eab6e71f
Date: 2016-01-19 15:56 +0100
http://bitbucket.org/cffi/cffi/changeset/8a31eab6e71f/
Log: issue #243: explicitly complain if ffi.def_extern() is called on the
Python-side FFI object
diff --git a/cffi/api.py b/cffi/api.py
--- a/cffi/api.py
+++ b/cffi/api.py
@@ -699,6 +699,10 @@
#
self._embedding = pysource
+ def def_extern(self, *args, **kwds):
+ raise ValueError("ffi.def_extern() is only available on API-mode FFI "
+ "objects")
+
def _load_backend_lib(backend, name, flags):
if name is None:
diff --git a/testing/cffi0/test_ffi_backend.py
b/testing/cffi0/test_ffi_backend.py
--- a/testing/cffi0/test_ffi_backend.py
+++ b/testing/cffi0/test_ffi_backend.py
@@ -419,3 +419,7 @@
]:
x = ffi.sizeof(name)
assert 1 <= x <= 16
+
+ def test_ffi_def_extern(self):
+ ffi = FFI()
+ py.test.raises(ValueError, ffi.def_extern)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit