ffi.new("undefined") raises confusing exception
ffi.new() with something that has not been defined previously, using
ffi.cdef(), a confusing exception is raised.
>>> from cffi import FFI >>> ffi = FFI() >>> ffi.new("undefined") Traceback (most recent call last): File "<input>", line 1, in <module> File "/Users/DasIch/Development/dotfiles/virtualenv/envs/benchmarking/lib/pyth on2.7/site-packages/cffi/api.py", line 171, in new cdecl = self._typeof(cdecl) File "/Users/DasIch/Development/dotfiles/virtualenv/envs/benchmarking/lib/pyth on2.7/site-packages/cffi/api.py", line 106, in _typeof consider_function_as_funcptr=cfaf) File "/Users/DasIch/Development/dotfiles/virtualenv/envs/benchmarking/lib/pyth on2.7/site-packages/cffi/cparser.py", line 193, in parse_type typenode = ast.ext[-1].type.args.params.type AttributeError: 'ID' object has no attribute 'type'
It would be nice to have an exception that explains the actual problem.
P.S.: I tried creating a patch for this issue, however cloning the repository and running tox (after installing the requirements in a virtualenv) produced a huge amount of failures, mostly in test_verify.py. Is there anything I should be aware of when setting up a development environment for working on cffi, that I might have missed; is this a known issue or one I should report?