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/generic.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'python/generic.cc') diff --git a/python/generic.cc b/python/generic.cc index f0980f2b..d08b12c0 100644 --- a/python/generic.cc +++ b/python/generic.cc @@ -101,7 +101,8 @@ PyObject *_PyAptObject_getattro(PyObject *self, PyObject *attr) { strlen(attrname) + 66]; sprintf(warning_string, "Attribute '%s' of the '%s' object is " "deprecated, use '%s' instead.", attrname, cls, newattrname); - PyErr_WarnEx(PyExc_DeprecationWarning, warning_string, 1); + if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL) + PyErr_WarnEx(PyExc_DeprecationWarning, warning_string, 1); delete[] warning_string; } else { Py_XINCREF(ptype); -- cgit v1.2.3