On 16-Dec-09, at 9:04 AM, Amaury Forgeot d'Arc wrote:
2009/12/16 Daniel Harding <dhard...@gmail.com>
okko.willeboor...@imtech.nl wrote:
When I run pylint through pylint.bat I do not get the return code
of pylint.
pylint.bat always returns 0
Could you please add 'exit(ERRORLEVEL)' after the exit: label to
solve this?
This change was made in changeset 75fca2f13e26 and released in pylint
0.18.1. However, now anytime pylint is run from a cmd.exe shell on
Windows, the exit call closes the shell, even if just doing something
like 'pylint --help'. This makes pylint essentially unusable from the
Windows command shell.
I agree with Daniel that it makes pylint unusable from the command
line in a Windows shell.
I've just found this in the Windows help:
C:\>help exit
EXIT [/B] [exitCode]
/B specifies to exit the current batch script instead of
CMD.EXE. If executed from outside a batch script, it
will quit CMD.EXE
Some research shows that this switch exists since windows 2000.
Wouldn't it help in our case?
I can confirm that the /B option prevents closing the cmd.exe shell.
I tried it in Windows XP SP3 and it worked. So, if pylint.bat keeps
the EXIT command, the /B option should be added.
However, I wonder why we use a batch file to launch pylint. Why not
write a python script that would be called pylint.py stored inside
the Scripts directory? Under Windows, if the .py extension is listed
in PATHEXT then you can execute a python script simply by typing its
name. Would it not be simpler? Just my 2 centimes.
Cheers
Pierre
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects