[Python-Dev] ImportWarning flood

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Thu Jun 22 07:34:53 CEST 2006


--- Guido van Rossum <guido at python.org> wrote:

> On 6/21/06, Ralf W. Grosse-Kunstleve <rwgk at yahoo.com> wrote:
> > I am getting tons of "ImportWarning: Not importing directory". See below
> for
> > examples. It is impractical for me to reorganize our directory structure.
> I'd
> > be busy for a week or more and people would probably scream at me because
> all
> > the paths have changed. Are there other options to get rid of the warnings?
> 
> Check out the -W command line option and the warnings module. These
> document how to suppress warnings.

Thanks!

This does the trick:

python -W'ignore:Not importing directory'

But this doesn't:

python -W'ignore:Not importing directory:ImportWarning'

I tried a bunch of variations without success. A few examples here would be
very valuable:

http://docs.python.org/lib/warning-filter.html

Also, the magic incantation to silence the warnings would be very helpful here:

http://docs.python.org/dev/whatsnew/other-lang.html

Is there a way to set the warning options via an environment variable?
Otherwise I am forced to use a wrapper or aliases.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Python-Dev mailing list