[Python-projects] Syntax Errors while installing PyLint
Sylvain =?UTF-8?Q?Th=E9nault?=
sylvain.thenault at logilab.fr
Tue Oct 16 09:00:42 CEST 2007
On Mon, Oct 15, 2007 at 05:52:28PM +0200, Maarten ter Huurne wrote:
> > > byte-compiling
> > > C:\bn\Python23\Lib\site-packages\pylint\test\input\func_continue_
> > > not_in_loop.py to func_continue_not_in_loop.pyc
> > > File
> > > "C:\bn\Python23\Lib\site-packages\pylint\test\input\func_continue_not_in
> > > _
> > > loop.py", line 8
> > > continue
> > > SyntaxError: 'continue' not properly in loop
> > >
> > > byte-compiling
> > > C:\bn\Python23\Lib\site-packages\pylint\test\input\func_genexpr_v
> > > ar_scope_py24.py to func_genexpr_var_scope_py24.pyc
> > > File
> > > "C:\bn\Python23\Lib\site-packages\pylint\test\input\func_genexpr_var_sco
> > > p
> > > e_py24.py", line 5
> > > __revision__ = list(n for n in range(10))
> > > ^
> > > SyntaxError: invalid syntax
> >
> >
> > If you take a closer look at these errors, you will see that the
> > problem occurs in the test suite. Some of the code snippets used in
> > the test suite are indeed written for python2.4 but it does not affect
> > pylint itself.
>
> I don't think the Python version is an issue here. The continue statement has
> been there for quite a while: it is present in Python 2.2 and probably even
> longer than that. Also, "SyntaxError: 'continue' not properly in loop" in a
> file named "func_continue_not_in_loop.py" makes it sound intentional.
it is actually intentional. And the python version is responsible for
the 2nd syntax error (use of a generator expression).
> > The real problem is that we should test disutils to ignore the
> > `tests` directory.
>
> I've seen similar errors on Linux (Ubuntu), it happened when installing other
> Python modules after PyLint. There seems to be a post-installation step that
> byte-compiles all Python modules. This includes the PyLint tests, which should
> have syntax errors in them, because they test whether PyLint reports those
> syntax errors correctly.
This is much probably a packaging pb : on debian systems, tests should be
installed in /usr/share/doc/pylint. I'll check our debian package and
why distutils try to install the test directory.
--
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