summaryrefslogtreecommitdiff
path: root/python/generic.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2013-10-23 19:38:48 +0200
committerJulian Andres Klode <jak@debian.org>2013-10-23 19:38:48 +0200
commitea815d93dda86504518bdf69488b1f336f2439a3 (patch)
tree76b2899f7ef8913392b8994fc7592292a7402624 /python/generic.h
parent0d616ec4ef49064412b27275dbbb1cb04b546fb5 (diff)
downloadpython-apt-ea815d93dda86504518bdf69488b1f336f2439a3.tar.gz
python/{depcache.cc,string.cc}: Ignore deprecation warnings for some calls
Those functions are deprecated in APT, but we still need to provide them for backwards compatibility.
Diffstat (limited to 'python/generic.h')
-rw-r--r--python/generic.h5
1 files changed, 5 insertions, 0 deletions
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.