disabling DeprecationWarning ?

Fredrik Lundh fredrik at pythonware.com
Mon Jun 4 20:16:15 CEST 2001


Clark C. Evans wrote:

> I have alot of older modules (that I'd rather not
> upgrade at this time), such as Mailman that
> constantly complain about the regex module
> DeprecationWarning.  Anyway, this stuff generates
> huge log files and is distracting.  I know
> the regex module is deprechated.  Is there a way
> to re-compile python 2.1 so that it doesn't complain?

no.

any reason you cannot just leave a 2.0 installation in place,
and use it for the old code?

if you insist, you can patch your site.py or sitecustomize.py
file to switch off warnings, using something like:

    import warnings
    warnings.filterwarnings("ignore")

also see section 5 of:

    http://www.amk.ca/python/2.1/index.html

and the library reference (the "warnings" module).

Cheers /F





More information about the Python-list mailing list