]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2438] make sure intermediate errors are cleared.
authorJINMEI Tatuya <jinmei@isc.org>
Fri, 4 Jan 2013 22:15:50 +0000 (14:15 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Wed, 9 Jan 2013 22:31:21 +0000 (14:31 -0800)
src/lib/dns/python/rrset_collection_python.cc

index 82cfdf32cb53060f2b7fa62f64c5752cf6152582..0834026a0f228ffbdff972373f1f708019b5265a 100644 (file)
@@ -234,6 +234,7 @@ RRsetCollection_init(PyObject* po_self, PyObject* args, PyObject*) {
             return (0);
         } else if (PyArg_ParseTuple(args, "y*O!O!", &py_buf, &name_type,
                                     &po_name,&rrclass_type, &po_rrclass)) {
+            PyErr_Clear();      // clear the error for the first ParseTuple
             const char* const cp = static_cast<const char*>(py_buf.buf);
             std::istringstream iss(string(cp, cp + py_buf.len));
             self->cppobj =
@@ -241,6 +242,7 @@ RRsetCollection_init(PyObject* po_self, PyObject* args, PyObject*) {
                                     PyRRClass_ToRRClass(po_rrclass));
             return (0);
         } else if (PyArg_ParseTuple(args, "")) {
+            PyErr_Clear();      // clear the error for the second ParseTuple
             self->cppobj = new RRsetCollection;
             return (0);
         }