]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[trac2116/master] don't set pyerr string in Name.split() on success.
authorJINMEI Tatuya <jinmei@isc.org>
Tue, 17 Jul 2012 20:23:15 +0000 (13:23 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Tue, 17 Jul 2012 20:23:15 +0000 (13:23 -0700)
src/lib/dns/python/name_python.cc

index 277595a49fcbfc62d9119eddf78290f7521bbe97..2799db9fdea2827465dd8c5d1eb11534efc0ab96 100644 (file)
@@ -386,7 +386,7 @@ Name_split(s_Name* self, PyObject* args) {
             ret->cppobj = NULL;
             try {
                 ret->cppobj = new Name(self->cppobj->split(first, n));
-            } catch(const isc::OutOfRange& oor) {
+            } catch (const isc::OutOfRange& oor) {
                 PyErr_SetString(PyExc_IndexError, oor.what());
                 ret->cppobj = NULL;
             }
@@ -408,7 +408,7 @@ Name_split(s_Name* self, PyObject* args) {
             ret->cppobj = NULL;
             try {
                 ret->cppobj = new Name(self->cppobj->split(n));
-            } catch(const isc::OutOfRange& oor) {
+            } catch (const isc::OutOfRange& oor) {
                 PyErr_SetString(PyExc_IndexError, oor.what());
                 ret->cppobj = NULL;
             }
@@ -417,11 +417,10 @@ Name_split(s_Name* self, PyObject* args) {
                 return (NULL);
             }
         }
+    } else {
+        PyErr_Clear();
+        PyErr_SetString(PyExc_TypeError, "No valid type in split argument");
     }
-
-    PyErr_Clear();
-    PyErr_SetString(PyExc_TypeError,
-                    "No valid type in split argument");
     return (ret);
 }