summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/apt_pkgmodule.cc4
-rw-r--r--python/apt_pkgmodule.h2
-rw-r--r--python/tag.cc2
3 files changed, 8 insertions, 0 deletions
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc
index 7704aa01..1a991a48 100644
--- a/python/apt_pkgmodule.cc
+++ b/python/apt_pkgmodule.cc
@@ -537,8 +537,10 @@ static PyMethodDef methods[] =
"Translate the given string. This is much faster than Python's version\n"
"and only does translations after setlocale() has been called."},
+#ifdef HAVE_OPEN_MEMSTREAM
// Tag File
{"rewrite_section",RewriteSection,METH_VARARGS,doc_RewriteSection},
+#endif
// Locking
{"get_lock",GetLock,METH_VARARGS,doc_GetLock},
@@ -623,7 +625,9 @@ static PyMethodDef methods[] =
{"ParseSection",ParseSection,METH_VARARGS,doc_ParseSection},
{"ParseTagFile",ParseTagFile,METH_VARARGS,doc_ParseTagFile},
+#ifdef HAVE_OPEN_MEMSTREAM
{"RewriteSection",RewriteSection,METH_VARARGS,doc_RewriteSection},
+#endif
{"GetLock",GetLock,METH_VARARGS,doc_GetLock},
{"PkgSystemLock",PkgSystemLock,METH_VARARGS,doc_PkgSystemLock},
diff --git a/python/apt_pkgmodule.h b/python/apt_pkgmodule.h
index 85c34130..1eb0e2f1 100644
--- a/python/apt_pkgmodule.h
+++ b/python/apt_pkgmodule.h
@@ -45,7 +45,9 @@ extern PyTypeObject PyTagSection_Type;
extern PyTypeObject PyTagFile_Type;
extern char *doc_ParseSection;
extern char *doc_ParseTagFile;
+#ifdef HAVE_OPEN_MEMSTREAM
extern char *doc_RewriteSection;
+#endif
PyObject *ParseSection(PyObject *self,PyObject *Args);
PyObject *ParseTagFile(PyObject *self,PyObject *Args);
PyObject *RewriteSection(PyObject *self,PyObject *Args);
diff --git a/python/tag.cc b/python/tag.cc
index 6ae439f5..46fb8f34 100644
--- a/python/tag.cc
+++ b/python/tag.cc
@@ -517,6 +517,7 @@ PyObject *ParseTagFile(PyObject *self,PyObject *Args) {
}
#endif
/*}}}*/
+#ifdef HAVE_OPEN_MEMSTREAM
// RewriteSection - Rewrite a section.. /*{{{*/
// ---------------------------------------------------------------------
/* An interesting future extension would be to add a user settable
@@ -586,6 +587,7 @@ PyObject *RewriteSection(PyObject *self,PyObject *Args)
return HandleErrors(ResObj);
}
/*}}}*/
+#endif // HAVE_OPEN_MEMSTREAM
// Method table for the Tag Section object
static PyMethodDef TagSecMethods[] =