How do I disable warnings?

Discussion in 'Python' started by Grant Edwards, Sep 10, 2007.

  1. 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!
     
    Grant Edwards, Sep 10, 2007
    #1
    1. Advertising

  2. Grant Edwards

    Guest

    On Sep 10, 12:34 pm, Grant Edwards <> 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
     
    , Sep 10, 2007
    #2
    1. Advertising

  3. On 2007-09-10, <> 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!!!
     
    Grant Edwards, Sep 10, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tuukka Toivonen

    disabling certain warnings in synopsys dc

    Tuukka Toivonen, May 11, 2004, in forum: VHDL
    Replies:
    1
    Views:
    1,691
    Tuukka Toivonen
    May 11, 2004
  2. Jason Heyes
    Replies:
    3
    Views:
    2,151
    Gene Wirchenko
    Dec 9, 2003
  3. Asfand Yar Qazi
    Replies:
    1
    Views:
    153
    Florian GroƟ
    Mar 19, 2006
  4. Ted Sung
    Replies:
    1
    Views:
    336
    Sherm Pendley
    Aug 30, 2004
  5. Replies:
    4
    Views:
    198
    comp.llang.perl.moderated
    Mar 2, 2007
Loading...

Share This Page