How to suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead"

John Nagle nagle at animats.com
Sat Feb 3 12:49:19 EST 2007


Gabriel Genellina wrote:
> En Sat, 03 Feb 2007 06:12:33 -0300, Peter Otten <__peter__ at web.de>  
> escribió:
> 
>> John Nagle wrote:
>>
>>>    How do I suppress "DeprecationWarning: Old style callback, use
>>>    cb_func(ok,
>>> store) instead".  A library is triggering this message, the library is
>>> being fixed, but I need to make the message disappear from the 
>>> output  of a
>>> CGI program.
>>
>>
>> import warnings
>> warnings.filterwarnings("ignore", message="Old style callback, use
>> cb_func(ok, store) instead")

    Thanks.

    Actually, just copying the message into the string doesn't work; the
matching argument is a regular expression, so "(" has special meaning.
But the general idea is right.

				John Nagle



More information about the Python-list mailing list