Pierre Rouleau wrote: > > On 16-Dec-09, at 9:04 AM, Amaury Forgeot d'Arc wrote: > >> 2009/12/16 Daniel Harding <dhard...@gmail.com >> <mailto:dhard...@gmail.com>> >>> >>> okko.willeboor...@imtech.nl <mailto: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.
Actually, the /B option doesn't help - it does prevent closing the cmd.exe shell, but using it goes back to the original case of pylint.bat always having a return code of 0, which is why the call to EXIT was added in the first place. > 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? That would be a simpler implementation, but it would require more work by the user to use pylint. AFAIK, the Python installer doesn't put .PY in PATHEXT, so a user wouldn't be able to just invoke 'pylint' out of the box. Cheers, Daniel Harding _______________________________________________ Python-Projects mailing list Python-Projects@lists.logilab.org http://lists.logilab.org/mailman/listinfo/python-projects