f



How do I disable warnings?

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?

-- 
Grant Edwards                   grante             Yow! And then we could sit
                                  at               on the hoods of cars at
                               visi.com            stop lights!
0
grante (5416)
9/10/2007 7:34:21 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

2 Replies
716 Views

Similar Articles

[PageSpeed] 32

On Sep 10, 12:34 pm, Grant Edwards <gra...@visi.com> 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:

    http://groups.google.com/group/comp.lang.python/msg/9f604b477ad31ef3

--
Hope this helps,
Steven


0
9/10/2007 8:50:23 PM
On 2007-09-10, attn.steven.kuo@gmail.com <attn.steven.kuo@gmail.com> wrote:

>> 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.

Doh! Of course it's a compile-time warning.

> Refer to a previous discussion here:
>
>     http://groups.google.com/group/comp.lang.python/msg/9f604b477ad31ef3

Thanks.

-- 
Grant Edwards                   grante             Yow! The Osmonds!  You are
                                  at               all Osmonds!!  Throwing up
                               visi.com            on a freeway at dawn!!!
0
grante (5416)
9/10/2007 9:01:09 PM
Reply: