How do I disable warnings?

attn.steven.kuo at attn.steven.kuo at
Mon Sep 10 22:50:23 CEST 2007

On Sep 10, 12:34 pm, Grant Edwards <gra... at> wrote:
> I've read the documentation for the warnings module, but I'm
> still unable to figure out how to disable a warning.
> I'd like to disable this warning:
>  Warning: 'with' will become a reserved keyword in Python 2.6
> AFAICT, the following should work.  But, it doesn't.
>   import warnings
>   warnings.filterwarnings('ignore',".*'with' will become a reserved keyword.*")
> What am I doing wrong?

That looks to be a compile-time warning.  Refer to a
previous discussion here:

Hope this helps,

More information about the Python-list mailing list