Re: Quietening deprecation warnings?
On Sa, 2011-03-05 at 22:40 +0000, Adam D. Barratt wrote:
> Hi,
>
> Whilst having a look at some of the changes that would be required to
> release team tools when the ftp-master host gets upgraded to Squeeze, I
> noticed that apt_pkg.ParseTagFile() has been deprecated and using it
> results in a warning being thrown to stderr.
>
> I'd like to be able to prepare for the switch by patching the code to
> cope with both the old and new python-apt APIs, but it appears that the
> warnings are simply printed on stderr rather than raised as exceptions
> which could then be handled.
It's not an exception, it's a warning; and it's using standard Python
warnings. See Python's documentation of the 'warnings' module for
information on how to deal with them.
--
Julian Andres Klode - Debian Developer, Ubuntu Member
See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
Reply to: