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/apt_pkgmodule.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'python/apt_pkgmodule.cc') diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc index 3d40832b..2a181619 100644 --- a/python/apt_pkgmodule.cc +++ b/python/apt_pkgmodule.cc @@ -54,8 +54,9 @@ static PyObject *py_gettext(PyObject *self, PyObject *Args) { static char *doc_newConfiguration = "Construct a configuration instance"; static PyObject *newConfiguration(PyObject *self,PyObject *args) { - PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.newConfiguration() is " - "deprecated. Use apt_pkg.Configuration() instead.", 1); + if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL) + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.newConfiguration() is " + "deprecated. Use apt_pkg.Configuration() instead.", 1); return CppPyObject_NEW(NULL, &PyConfiguration_Type, new Configuration()); } #endif -- cgit v1.2.3