summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/depcache.cc2
-rw-r--r--python/generic.h5
-rw-r--r--python/string.cc2
3 files changed, 9 insertions, 0 deletions
diff --git a/python/depcache.cc b/python/depcache.cc
index 9f4b91b4..b257e2c9 100644
--- a/python/depcache.cc
+++ b/python/depcache.cc
@@ -895,7 +895,9 @@ static PyObject *PkgProblemResolverInstallProtect(PyObject *Self,PyObject *Args)
pkgProblemResolver *fixer = GetCpp<pkgProblemResolver *>(Self);
if (PyArg_ParseTuple(Args,"") == 0)
return 0;
+ PY_APT_BEGIN_DEPRECATED;
fixer->InstallProtect();
+ PY_APT_END_DEPRECATED;
Py_INCREF(Py_None);
return HandleErrors(Py_None);
}
diff --git a/python/generic.h b/python/generic.h
index c9db916c..26736f1a 100644
--- a/python/generic.h
+++ b/python/generic.h
@@ -75,6 +75,11 @@ typedef int Py_ssize_t;
#define PyErr_WarnEx(cat,msg,stacklevel) PyErr_Warn(cat,msg)
#endif
+#define PY_APT_BEGIN_DEPRECATED { \
+ _Pragma("GCC diagnostic push"); \
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\""); }
+#define PY_APT_END_DEPRECATED _Pragma("GCC diagnostic pop")
+
static inline const char *PyUnicode_AsString(PyObject *op) {
// Convert to bytes object, using the default encoding.
diff --git a/python/string.cc b/python/string.cc
index 62aa34e7..9b02c933 100644
--- a/python/string.cc
+++ b/python/string.cc
@@ -113,8 +113,10 @@ PyObject *StrStrToTime(PyObject *Self,PyObject *Args)
return 0;
time_t Result;
+ PY_APT_BEGIN_DEPRECATED;
if (StrToTime(Str,Result) == false)
{
+ PY_APT_END_DEPRECATED;
Py_INCREF(Py_None);
return Py_None;
}