how to pychecker recursively

Follower follower at iname.com
Fri Feb 21 00:26:20 EST 2003


> I don't know what it would take to modify pychecker.
I do. Time, mostly. :-) *

> Philip Lindsay started a patch, 
I don't think the patch I've been working on will help in this
situation, it's geared more towards running Pychecker over package
hierarchies.

(It is possible to call pychecker with multiple files so if you know
the import order of your files you could make sure the "lower" files
are checked first. At least then your error messages should be more
helpful.

e.g. If 'a.py' imports 'b.y' you should be able to run:

pychecker b.y a.py

)

> but I think there were problems with it.
I've got it working well enough that we're using it at work, the
problem is related to cross-platform differences in the implementation
of __import__(). It seems that Python on Linux behaves differently to
Windows when a full dotted module path includes directory separator
characters (which is a situation that should be illegal but Linux
versions seem happy to accept). There seems to even be a difference
between 2.2.1 and 2.2.2, although I haven't looked deeply into that.

I originally raised this issue in a post to this group entitled
"Directory separator in module name using '__import__()' cross
platform difference" but got no response.

If you're using Linux then my package checking additions should work,
let me know if you want the changes.

--Phil.

* I have to say Pychecker is, in my experience, nicely modularised, I
was able to make my changes to just one file and pretty much ignore
how the rest of the program worked.




More information about the Python-list mailing list