Commit 63b07168 authored by Armin Rigo's avatar Armin Rigo
Browse files

ffi.include(ffi) doesn't make sense and hangs right now

parent 9d86b893ad22
......@@ -428,6 +428,8 @@ class FFI(object):
raise TypeError("ffi.include() expects an argument that is also of"
" type cffi.FFI, not %r" % (
if ffi_to_include is self:
raise ValueError("self.include(self)")
with ffi_to_include._lock:
with self._lock:
......@@ -1770,3 +1770,7 @@ class BackendTests:
py.test.raises(TypeError,, "struct foo_s *")
ffi.cdef("struct foo_s { int x; };")"struct foo_s *")
def test_ffi_self_include(self):
ffi = FFI(backend=self.Backend())
py.test.raises(ValueError, ffi.include, ffi)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment