diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-03-29 13:20:52 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-03-29 13:20:52 +0200 |
| commit | 4b74ecd4df220fcb9939445a9774bbcf6ba3212e (patch) | |
| tree | fe24df1f2b3c5c1fd3dd4dc171bbfd5d2f8bc694 /python/depcache.cc | |
| parent | 4f1a8ff1fcd780c2d42dbc59f41ca38581e6f10c (diff) | |
| download | python-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/depcache.cc')
| -rw-r--r-- | python/depcache.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/python/depcache.cc b/python/depcache.cc index 8b4e02b5..0d5d7882 100644 --- a/python/depcache.cc +++ b/python/depcache.cc @@ -694,8 +694,9 @@ PyTypeObject PyDepCache_Type = #ifdef COMPAT_0_7 PyObject *GetDepCache(PyObject *Self,PyObject *Args) { - PyErr_WarnEx(PyExc_DeprecationWarning,"apt_pkg.GetDepCache() is deprecated" - ". Please see apt_pkg.DepCache() for the replacement.",1); + if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL) + PyErr_WarnEx(PyExc_DeprecationWarning,"apt_pkg.GetDepCache() is deprecated" + ". Please see apt_pkg.DepCache() for the replacement.",1); return PkgDepCacheNew(&PyDepCache_Type,Args,0); } #endif @@ -728,9 +729,10 @@ static PyObject *PkgProblemResolverNew(PyTypeObject *type,PyObject *Args,PyObjec #ifdef COMPAT_0_7 PyObject *GetPkgProblemResolver(PyObject *Self,PyObject *Args) { - PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgProblemResolver() is" - " deprecated. Please see apt_pkg.ProblemResolver() for the " - "replacement.", 1); + if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL) + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgProblemResolver() is" + " deprecated. Please see apt_pkg.ProblemResolver() for the " + "replacement.", 1); return PkgProblemResolverNew(&PyProblemResolver_Type,Args,0); } #endif @@ -989,9 +991,10 @@ PyTypeObject PyActionGroup_Type = #ifdef COMPAT_0_7 PyObject *GetPkgActionGroup(PyObject *Self,PyObject *Args) { - PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgActionGroup() is " - "deprecated. Please see apt_pkg.ActionGroup() for the " - "replacement.", 1); + if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL) + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgActionGroup() is " + "deprecated. Please see apt_pkg.ActionGroup() for the " + "replacement.", 1); return PkgActionGroupNew(&PyActionGroup_Type,Args,0); } #endif |
