[Python-projects] astng 0.18.0 not compatible with Python 2.6?

Sylvain Thénault sylvain.thenault at logilab.fr
Mon Mar 23 09:32:05 CET 2009


Le Saturday 21 March 2009 14:27:44 Maarten ter Huurne, vous avez écrit :
> I just installed pylint 0.17.0 and astng 0.18.0 and unfortunately I cannot
> get it to do anything at all. This is on Python 2.6 on SUSE Linux x86_64.
>
> $ pylint -rn hello.py
> Traceback (most recent call last):
[...]
>   File "/usr/local/lib64/python2.6/site-packages/logilab/astng/utils.py",
> line 40, in extend_class
>     setattr(original, k, v)
> TypeError: can't set attributes of built-in/extension type '_ast.AST'
>
> The same error occurs on "from logilab import astng". It seems the Python
> 2.6 version of "_ast.AST" does not allow adding attributes:
>
> Python 2.6 (r26:66714, Feb  3 2009, 20:49:49)
> [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import _ast
> >>> _ast.AST
>
> <type '_ast.AST'>
>
> >>> setattr(_ast.AST, 'test', 1)
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: can't set attributes of built-in/extension type '_ast.AST'

> Note that "_ast.AST" changed from class (2.5) to type (2.6).

gasp! All our tests have been done using 2.4/2.5 :( Grmmmbl! If astng can't 
rely any more on monkey patching...

-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Python et calcul scientifique:           http://www.logilab.fr/science


More information about the Python-Projects mailing list