summaryrefslogtreecommitdiff
path: root/python/tag.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-03-29 14:22:11 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-03-29 14:22:11 +0200
commit82dc1170b0b29f7bb264d046d1c9253f4d97fb10 (patch)
treefe24df1f2b3c5c1fd3dd4dc171bbfd5d2f8bc694 /python/tag.cc
parent4f1a8ff1fcd780c2d42dbc59f41ca38581e6f10c (diff)
parent4b74ecd4df220fcb9939445a9774bbcf6ba3212e (diff)
downloadpython-apt-82dc1170b0b29f7bb264d046d1c9253f4d97fb10.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/tag.cc')
-rw-r--r--python/tag.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/python/tag.cc b/python/tag.cc
index c7edcb31..bc470620 100644
--- a/python/tag.cc
+++ b/python/tag.cc
@@ -349,9 +349,10 @@ static PyObject *TagSecNew(PyTypeObject *type,PyObject *Args,PyObject *kwds) {
char *doc_ParseSection ="ParseSection(Text) -> TagSection() object. Deprecated.";
PyObject *ParseSection(PyObject *self,PyObject *Args)
{
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.ParseSection() is "
- "deprecated. Please see apt_pkg.TagSection() for the "
- "replacement.", 1);
+ if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.ParseSection() is "
+ "deprecated. Please see apt_pkg.TagSection() for the "
+ "replacement.", 1);
return TagSecNew(&PyTagSection_Type,Args,0);
}
#endif
@@ -388,9 +389,10 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
#ifdef COMPAT_0_7
char *doc_ParseTagFile = "ParseTagFile(File) -> TagFile() object. Deprecated.";
PyObject *ParseTagFile(PyObject *self,PyObject *Args) {
- PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.ParseTagFile() is "
- "deprecated. Please see apt_pkg.TagFile() for the "
- "replacement.", 1);
+ if (getenv("PYTHON_APT_DEPRECATION_WARNINGS") != NULL)
+ PyErr_WarnEx(PyExc_DeprecationWarning, "apt_pkg.ParseTagFile() is "
+ "deprecated. Please see apt_pkg.TagFile() for the "
+ "replacement.", 1);
return TagFileNew(&PyTagFile_Type,Args,0);
}
#endif