J'essaye d'exécuter un exemple trouvé here, mais il échoue toujours à s'exécuter. Après un certain débogage, j'ai découvert que les node.get_children() provoque l'exception, et voici le retraçage:La liaison python de clang lève une exception quand get_children est appelée
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 314, in 'calling callback function'
File "C:\Python27\lib\site-packages\clang\cindex.py", line 1383, in visitor
children.append(child)
AttributeError: 'str' object has no attribute 'append'
J'utilise LLVM 4.0.1 sous Windows, et j'ai installé clang par pip (essayé les deux clang3.5 et clang4.0.post1).
Voici mon LD_LIBRARY_PATH: C: \ Program Files \ LLVM \ bin, que j'ajouté dans mon PATH comme ceci:% LD_LIBRARY_PATH%;% PYTHONPATH%, ... reste ... chemin
I a eu la même erreur après l'installation de LLVM5.0 et clonage clang de github.
EDIT: J'ai utilisé Python2.7, mais après le passage à Python 3.6.3 tout fonctionne bien.