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/pkgrecords.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/pkgrecords.cc')
| -rw-r--r-- | python/pkgrecords.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/pkgrecords.cc b/python/pkgrecords.cc index 0e00edcd..916a2e0f 100644 --- a/python/pkgrecords.cc +++ b/python/pkgrecords.cc @@ -195,9 +195,10 @@ PyTypeObject PyPackageRecords_Type = #ifdef COMPAT_0_7 PyObject *GetPkgRecords(PyObject *Self,PyObject *Args) { - PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgRecords() is " - "deprecated. Please see apt_pkg.Records() for the " - "replacement.", 1); + if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL) + PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.GetPkgRecords() is " + "deprecated. Please see apt_pkg.Records() for the " + "replacement.", 1); return PkgRecordsNew(&PyPackageRecords_Type,Args,0); } #endif |
