From: Jelte Jansen Date: Mon, 17 Dec 2012 13:57:52 +0000 (+0100) Subject: [2379] Add separate initializer for NameComparisonResult type X-Git-Tag: bind10-1.0.0-beta-release~11^2^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca8707b6528b0779ce9cc6de42169d53af561b8a;p=thirdparty%2Fkea.git [2379] Add separate initializer for NameComparisonResult type --- diff --git a/src/lib/dns/python/pydnspp.cc b/src/lib/dns/python/pydnspp.cc index a58b9d276c..443a21a818 100644 --- a/src/lib/dns/python/pydnspp.cc +++ b/src/lib/dns/python/pydnspp.cc @@ -187,11 +187,7 @@ initModulePart_MessageRenderer(PyObject* mod) { } bool -initModulePart_Name(PyObject* mod) { - - // - // NameComparisonResult - // +initModulePart_NameComparisonResult(PyObject* mod) { if (!initClass(name_comparison_result_type, "NameComparisonResult", mod)) { return (false); @@ -215,10 +211,11 @@ initModulePart_Name(PyObject* mod) { addClassVariable(name_comparison_result_type, "COMMONANCESTOR", Py_BuildValue("I", NameComparisonResult::COMMONANCESTOR)); + return (true); +} - // - // Name - // +bool +initModulePart_Name(PyObject* mod) { if (!initClass(name_type, "Name", mod)) { return (false); } @@ -240,8 +237,6 @@ initModulePart_Name(PyObject* mod) { addClassVariable(name_type, "ROOT_NAME", createNameObject(Name::ROOT_NAME())); - - // Add the exceptions to the module try { po_EmptyLabel = PyErr_NewException("pydnspp.EmptyLabel", NULL, NULL); @@ -785,6 +780,10 @@ PyInit_pydnspp(void) { // for each part included above, we call its specific initializer + if (!initModulePart_NameComparisonResult(mod)) { + return (NULL); + } + if (!initModulePart_Name(mod)) { return (NULL); }