summaryrefslogtreecommitdiff
path: root/python/sourcelist.cc
diff options
context:
space:
mode:
Diffstat (limited to 'python/sourcelist.cc')
-rw-r--r--python/sourcelist.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/sourcelist.cc b/python/sourcelist.cc
index 6184fee3..5a950b2c 100644
--- a/python/sourcelist.cc
+++ b/python/sourcelist.cc
@@ -157,9 +157,10 @@ PyTypeObject PySourceList_Type =
#ifdef COMPAT_0_7
PyObject *GetPkgSourceList(PyObject *Self,PyObject *Args)
{
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgSourceList() is "
- "deprecated. Please see apt_pkg.SourceList() for the "
- "replacement.", 1);
+ if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgSourceList() is "
+ "deprecated. Please see apt_pkg.SourceList() for the "
+ "replacement.", 1);
return PkgSourceListNew(&PySourceList_Type,Args,0);
}
#endif