How do I disable warnings?

G

Grant Edwards

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?
 
A

attn.steven.kuo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top