summaryrefslogtreecommitdiff
path: root/python/acquire.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-03-29 13:20:52 +0200
committerJulian Andres Klode <jak@debian.org>2010-03-29 13:20:52 +0200
commit4b74ecd4df220fcb9939445a9774bbcf6ba3212e (patch)
treefe24df1f2b3c5c1fd3dd4dc171bbfd5d2f8bc694 /python/acquire.cc
parent4f1a8ff1fcd780c2d42dbc59f41ca38581e6f10c (diff)
downloadpython-apt-4b74ecd4df220fcb9939445a9774bbcf6ba3212e.tar.gz
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)
Diffstat (limited to 'python/acquire.cc')
-rw-r--r--python/acquire.cc5
1 files changed, 3 insertions, 2 deletions
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