pychecker checks files by executing them ??

Just just at xs4all.nl
Tue Jun 3 19:50:13 CEST 2003


In article <u1b7xkwr.fsf at python.net>,
 Thomas Heller <theller at python.net> wrote:

> Axel Kowald <kowald at molgen.mpg.de> writes:
> 
> > I got pychecker and installed it on my w2k machine as described. It
> > also seems to work, but when I do:
> > 
> > pychecker myFile.py   it actually "executes"  myFile.py, while
> > checking it. Is this the correct behaviour??
>
> > Obviously I would like to check my scripts without executing them. Any
> > idea what's going on ?
> > 
> pychecker imports them, not executes them.

Hm, I don't understand how you can make that distinction: if you import 
a module, it gets executed.

> Protect the main function or
> what it is in your case by the usual 'if __name__ == "__main__":' idiom
> (which you should do anyway IMO), and you are fine.

True. Yet it would be far better if PyChecker would analyze the compiled 
byte code instead of executing it. The same goes for pydoc btw.

Just




More information about the Python-list mailing list