From 4b74ecd4df220fcb9939445a9774bbcf6ba3212e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 29 Mar 2010 13:20:52 +0200 Subject: If PYTHON_APT_DEPRECATION_WARNINGS is unset, also disable the deprecation warnings in apt_pkg directly; and don't just disable any deprecation warning in apt/__init__.py (LP: #548623) --- python/acquire.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'python/acquire.cc') diff --git a/python/acquire.cc b/python/acquire.cc index cc9ee310..3f24a3e7 100644 --- a/python/acquire.cc +++ b/python/acquire.cc @@ -372,8 +372,9 @@ PyTypeObject PyAcquire_Type = { #ifdef COMPAT_0_7 PyObject *GetAcquire(PyObject *Self,PyObject *Args) { - PyErr_WarnEx(PyExc_DeprecationWarning,"apt_pkg.GetAcquire() is deprecated." - " Please see apt_pkg.Acquire() for the replacement.", 1); + if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL) + PyErr_WarnEx(PyExc_DeprecationWarning,"apt_pkg.GetAcquire() is deprecated." + " Please see apt_pkg.Acquire() for the replacement.", 1); return PkgAcquireNew(&PyAcquire_Type,Args,0); } #endif -- cgit v1.2.3