diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2007-11-29 12:07:01 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2007-11-29 12:07:01 +0100 |
| commit | ef9c8e692fd184824d29cba42c26daa9b20bdfdb (patch) | |
| tree | f7f2073c00511550e921e837d9056a72bcdcc4a5 /python | |
| parent | 9fa44c4a7c9ba0b856858b268445bd0f87ee58ae (diff) | |
| download | python-apt-ef9c8e692fd184824d29cba42c26daa9b20bdfdb.tar.gz | |
* python/tag.cc
- support "None" as default in
ParseSection(control).get(field, default), LP: #44470
Diffstat (limited to 'python')
| -rw-r--r-- | python/tag.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/python/tag.cc b/python/tag.cc index d0d862c9..4b378a55 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -78,7 +78,7 @@ static PyObject *TagSecFind(PyObject *Self,PyObject *Args) { char *Name = 0; char *Default = 0; - if (PyArg_ParseTuple(Args,"s|s",&Name,&Default) == 0) + if (PyArg_ParseTuple(Args,"s|z",&Name,&Default) == 0) return 0; const char *Start; @@ -86,10 +86,7 @@ static PyObject *TagSecFind(PyObject *Self,PyObject *Args) if (GetCpp<pkgTagSection>(Self).Find(Name,Start,Stop) == false) { if (Default == 0) - { - Py_INCREF(Py_None); - return Py_None; - } + Py_RETURN_NONE; return PyString_FromString(Default); } return PyString_FromStringAndSize(Start,Stop-Start); |
