summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-06-10 18:43:06 +0200
committerMichael Vogt <mvo@debian.org>2014-06-10 18:43:06 +0200
commit133453cd78109e10f9f23168ba3e5923e9afffae (patch)
tree762b1ec940d5712e9c2ab0ef5290f040c655de18 /python
parent09079e23657cbe0b751499bd2860d0b2633c4ef8 (diff)
downloadpython-apt-133453cd78109e10f9f23168ba3e5923e9afffae.tar.gz
Revert "Merge remote-tracking branch 'mvo/feature/srcrec-enum' into debian/sid"
This reverts commit 1b6b123a052ca2d53e90b62da09ce300d701265a, reversing changes made to 9de6a183f09f0d0adbcc5817872c5a0024f5ef47.
Diffstat (limited to 'python')
-rw-r--r--python/pkgsrcrecords.cc24
-rw-r--r--python/tag.cc3
2 files changed, 1 insertions, 26 deletions
diff --git a/python/pkgsrcrecords.cc b/python/pkgsrcrecords.cc
index 308299e2..6a60a9af 100644
--- a/python/pkgsrcrecords.cc
+++ b/python/pkgsrcrecords.cc
@@ -75,34 +75,10 @@ static PyObject *PkgSrcRecordsRestart(PyObject *Self,PyObject *Args)
return HandleErrors(Py_None);
}
-static char *doc_PkgSrcRecordsStep =
- "step() -> bool\n\n"
- "Step to the next source package. Each call moves\n"
- "the position of the records parser forward. If there are no\n"
- "more records, return None. If the lookup failed this way,\n"
- "access to any of the attributes will result in an AttributeError.";
-static PyObject *PkgSrcRecordsStep(PyObject *Self,PyObject *Args)
-{
- PkgSrcRecordsStruct &Struct = GetCpp<PkgSrcRecordsStruct>(Self);
-
- if (PyArg_ParseTuple(Args,"") == 0)
- return 0;
-
- Struct.Last = (pkgSrcRecords::Parser*)Struct.Records->Next();
- if (Struct.Last == 0) {
- Struct.Records->Restart();
- Py_INCREF(Py_None);
- return HandleErrors(Py_None);
- }
-
- return PyBool_FromLong(1);
-}
-
static PyMethodDef PkgSrcRecordsMethods[] =
{
{"lookup",PkgSrcRecordsLookup,METH_VARARGS,doc_PkgSrcRecordsLookup},
{"restart",PkgSrcRecordsRestart,METH_VARARGS,doc_PkgSrcRecordsRestart},
- {"step",PkgSrcRecordsStep,METH_VARARGS,doc_PkgSrcRecordsStep},
{}
};
diff --git a/python/tag.cc b/python/tag.cc
index bab7811e..50786cee 100644
--- a/python/tag.cc
+++ b/python/tag.cc
@@ -290,8 +290,6 @@ static PyObject *TagSecStr(PyObject *Self)
const char *Start;
const char *Stop;
GetCpp<pkgTagSection>(Self).GetSection(Start,Stop);
- printf("%x\n", &GetCpp<pkgTagSection>(Self));
- std::cerr << Start << std::endl;
return TagSecString_FromStringAndSize(Self,Start,Stop-Start);
}
/*}}}*/
@@ -490,6 +488,7 @@ static PyObject *TagFileNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
New->Section = (TagSecData*)(&PyTagSection_Type)->tp_alloc(&PyTagSection_Type, 0);
new (&New->Section->Object) pkgTagSection();
New->Section->Owner = New;
+ Py_INCREF(New->Section->Owner);
New->Section->Data = 0;
New->Section->Bytes = Bytes;
#if PY_MAJOR_VERSION >= 3