BIND 10 trac1245, updated. cbf08d56345922d754182b941b84b18bfddabcda [1245] remove some unnecessary comments

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Sep 16 22:44:48 UTC 2011


The branch, trac1245 has been updated
       via  cbf08d56345922d754182b941b84b18bfddabcda (commit)
       via  84a95705e1e8219187e75433baec2fd2fc8ba2fe (commit)
       via  90b740caf4cc5d207dfa2ac98f1c73d9818792e2 (commit)
       via  0ea828cb5c74b0f9a254aeab2c7d31ff214371e5 (commit)
      from  aa5fd84d438cf165c9836fa545d15c33781401af (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cbf08d56345922d754182b941b84b18bfddabcda
Author: Jelte Jansen <jelte at isc.org>
Date:   Sat Sep 17 00:44:36 2011 +0200

    [1245] remove some unnecessary comments

commit 84a95705e1e8219187e75433baec2fd2fc8ba2fe
Merge: 90b740caf4cc5d207dfa2ac98f1c73d9818792e2 aa5fd84d438cf165c9836fa545d15c33781401af
Author: Jelte Jansen <jelte at isc.org>
Date:   Sat Sep 17 00:28:19 2011 +0200

    Merge branch 'trac1245' of ssh://git.bind10.isc.org/var/bind10/git/bind10 into trac1245

commit 90b740caf4cc5d207dfa2ac98f1c73d9818792e2
Author: Jelte Jansen <jelte at isc.org>
Date:   Fri Sep 16 23:11:34 2011 +0200

    [1245] namespace fix

commit 0ea828cb5c74b0f9a254aeab2c7d31ff214371e5
Author: Jelte Jansen <jelte at isc.org>
Date:   Fri Sep 16 22:52:11 2011 +0200

    [1245] raise exception in _Check() if obj is NULL

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dns/python/edns_python.cc            |    3 +++
 src/lib/dns/python/edns_python.h             |    2 ++
 src/lib/dns/python/message_python.h          |    5 -----
 src/lib/dns/python/messagerenderer_python.cc |    3 +++
 src/lib/dns/python/messagerenderer_python.h  |    2 ++
 src/lib/dns/python/name_python.cc            |    3 +++
 src/lib/dns/python/name_python.h             |    7 ++-----
 src/lib/dns/python/opcode_python.cc          |    3 +++
 src/lib/dns/python/opcode_python.h           |    2 ++
 src/lib/dns/python/pydnspp.cc                |    1 -
 src/lib/dns/python/pydnspp_common.cc         |    1 -
 src/lib/dns/python/question_python.cc        |    5 +++++
 src/lib/dns/python/question_python.h         |    7 ++-----
 src/lib/dns/python/rcode_python.cc           |    3 +++
 src/lib/dns/python/rcode_python.h            |    2 ++
 src/lib/dns/python/rdata_python.cc           |    3 +++
 src/lib/dns/python/rdata_python.h            |    7 ++-----
 src/lib/dns/python/rrclass_python.cc         |    3 +++
 src/lib/dns/python/rrclass_python.h          |    2 ++
 src/lib/dns/python/rrset_python.cc           |    3 +++
 src/lib/dns/python/rrset_python.h            |    7 ++-----
 src/lib/dns/python/rrttl_python.cc           |    3 +++
 src/lib/dns/python/rrttl_python.h            |    7 ++-----
 src/lib/dns/python/rrtype_python.cc          |    3 +++
 src/lib/dns/python/rrtype_python.h           |    7 ++-----
 src/lib/dns/python/tsig_python.cc            |   10 +++-------
 src/lib/dns/python/tsig_python.h             |    2 ++
 src/lib/dns/python/tsig_rdata_python.cc      |   13 ++++---------
 src/lib/dns/python/tsig_rdata_python.h       |    2 ++
 src/lib/dns/python/tsigerror_python.cc       |    8 --------
 src/lib/dns/python/tsigkey_python.cc         |   15 +++++++--------
 src/lib/dns/python/tsigkey_python.h          |    2 ++
 src/lib/dns/python/tsigrecord_python.cc      |    9 +++------
 src/lib/dns/python/tsigrecord_python.h       |    2 ++
 34 files changed, 82 insertions(+), 75 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/python/edns_python.cc b/src/lib/dns/python/edns_python.cc
index 8b5b584..df7e8a4 100644
--- a/src/lib/dns/python/edns_python.cc
+++ b/src/lib/dns/python/edns_python.cc
@@ -392,6 +392,9 @@ createEDNSObject(const EDNS& source) {
 
 bool
 PyEDNS_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &edns_type));
 }
 
diff --git a/src/lib/dns/python/edns_python.h b/src/lib/dns/python/edns_python.h
index a6d3c38..81869df 100644
--- a/src/lib/dns/python/edns_python.h
+++ b/src/lib/dns/python/edns_python.h
@@ -36,6 +36,8 @@ PyObject* createEDNSObject(const EDNS& source);
 
 /// \brief Checks if the given python object is a EDNS object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type EDNS, false otherwise
 bool PyEDNS_Check(PyObject* obj);
diff --git a/src/lib/dns/python/message_python.h b/src/lib/dns/python/message_python.h
index be1adb9..8ae3efc 100644
--- a/src/lib/dns/python/message_python.h
+++ b/src/lib/dns/python/message_python.h
@@ -23,11 +23,6 @@ namespace isc {
 namespace dns {
 namespace python {
 
-//
-// Declaration of the custom exceptions
-// Initialization and addition of these go in the module init at the
-// end
-//
 extern PyObject* po_MessageTooShort;
 extern PyObject* po_InvalidMessageSection;
 extern PyObject* po_InvalidMessageOperation;
diff --git a/src/lib/dns/python/messagerenderer_python.cc b/src/lib/dns/python/messagerenderer_python.cc
index 2c475d8..438dbb4 100644
--- a/src/lib/dns/python/messagerenderer_python.cc
+++ b/src/lib/dns/python/messagerenderer_python.cc
@@ -283,6 +283,9 @@ createMessageRendererObject(const MessageRenderer& source) {
 
 bool
 PyMessageRenderer_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &messagerenderer_type));
 }
 
diff --git a/src/lib/dns/python/messagerenderer_python.h b/src/lib/dns/python/messagerenderer_python.h
index 2f51853..bfd895a 100644
--- a/src/lib/dns/python/messagerenderer_python.h
+++ b/src/lib/dns/python/messagerenderer_python.h
@@ -37,6 +37,8 @@ PyObject* createMessageRendererObject(const MessageRenderer& source);
 
 /// \brief Checks if the given python object is a MessageRenderer object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type MessageRenderer, false otherwise
 bool PyMessageRenderer_Check(PyObject* obj);
diff --git a/src/lib/dns/python/name_python.cc b/src/lib/dns/python/name_python.cc
index e05f44d..6e60ba9 100644
--- a/src/lib/dns/python/name_python.cc
+++ b/src/lib/dns/python/name_python.cc
@@ -729,6 +729,9 @@ createNameObject(const Name& source) {
 
 bool
 PyName_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &name_type));
 }
 
diff --git a/src/lib/dns/python/name_python.h b/src/lib/dns/python/name_python.h
index 3667c35..fdf6e4a 100644
--- a/src/lib/dns/python/name_python.h
+++ b/src/lib/dns/python/name_python.h
@@ -23,11 +23,6 @@ namespace isc {
 namespace dns {
 namespace python {
 
-//
-// Declaration of the custom exceptions
-// Initialization and addition of these go in the module init at the
-// end
-//
 extern PyObject* po_EmptyLabel;
 extern PyObject* po_TooLongName;
 extern PyObject* po_TooLongLabel;
@@ -58,6 +53,8 @@ PyObject* createNameObject(const Name& source);
 
 /// \brief Checks if the given python object is a Name object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type Name, false otherwise
 bool PyName_Check(PyObject* obj);
diff --git a/src/lib/dns/python/opcode_python.cc b/src/lib/dns/python/opcode_python.cc
index d9b5545..ea76d99 100644
--- a/src/lib/dns/python/opcode_python.cc
+++ b/src/lib/dns/python/opcode_python.cc
@@ -404,6 +404,9 @@ createOpcodeObject(const Opcode& source) {
 
 bool
 PyOpcode_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &opcode_type));
 }
 
diff --git a/src/lib/dns/python/opcode_python.h b/src/lib/dns/python/opcode_python.h
index 04ee7e7..7286588 100644
--- a/src/lib/dns/python/opcode_python.h
+++ b/src/lib/dns/python/opcode_python.h
@@ -36,6 +36,8 @@ PyObject* createOpcodeObject(const Opcode& source);
 
 /// \brief Checks if the given python object is a Opcode object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type Opcode, false otherwise
 bool PyOpcode_Check(PyObject* obj);
diff --git a/src/lib/dns/python/pydnspp.cc b/src/lib/dns/python/pydnspp.cc
index 9d6bc56..4699e55 100644
--- a/src/lib/dns/python/pydnspp.cc
+++ b/src/lib/dns/python/pydnspp.cc
@@ -21,7 +21,6 @@
 // name initModulePart_<name>, and return true/false instead of
 // NULL/*mod
 //
-// And of course care has to be taken that all identifiers be unique
 
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
diff --git a/src/lib/dns/python/pydnspp_common.cc b/src/lib/dns/python/pydnspp_common.cc
index d47177b..0f0f873 100644
--- a/src/lib/dns/python/pydnspp_common.cc
+++ b/src/lib/dns/python/pydnspp_common.cc
@@ -41,7 +41,6 @@
 #include "question_python.h"
 #include "message_python.h"
 
-// order is important here!
 using namespace isc::dns::python;
 
 namespace isc {
diff --git a/src/lib/dns/python/question_python.cc b/src/lib/dns/python/question_python.cc
index 953a0c3..d595772 100644
--- a/src/lib/dns/python/question_python.cc
+++ b/src/lib/dns/python/question_python.cc
@@ -18,6 +18,7 @@
 #include <dns/messagerenderer.h>
 #include <dns/exceptions.h>
 #include <util/buffer.h>
+#include <util/python/pycppwrapper_util.h>
 
 #include "question_python.h"
 
@@ -29,6 +30,7 @@
 using namespace isc::dns;
 using namespace isc::dns::python;
 using namespace isc::util;
+using namespace isc::util::python;
 using namespace isc;
 
 namespace {
@@ -283,6 +285,9 @@ createQuestionObject(const Question& source) {
 
 bool
 PyQuestion_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &question_type));
 }
 
diff --git a/src/lib/dns/python/question_python.h b/src/lib/dns/python/question_python.h
index 1971b4b..4e8b2ab 100644
--- a/src/lib/dns/python/question_python.h
+++ b/src/lib/dns/python/question_python.h
@@ -23,11 +23,6 @@ namespace isc {
 namespace dns {
 namespace python {
 
-//
-// Declaration of the custom exceptions
-// Initialization and addition of these go in the module init at the
-// end
-//
 extern PyObject* po_EmptyQuestion;
 
 extern PyTypeObject question_type;
@@ -43,6 +38,8 @@ PyObject* createQuestionObject(const Question& source);
 
 /// \brief Checks if the given python object is a Question object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type Question, false otherwise
 bool PyQuestion_Check(PyObject* obj);
diff --git a/src/lib/dns/python/rcode_python.cc b/src/lib/dns/python/rcode_python.cc
index 8c4a985..cc79483 100644
--- a/src/lib/dns/python/rcode_python.cc
+++ b/src/lib/dns/python/rcode_python.cc
@@ -445,6 +445,9 @@ createRcodeObject(const Rcode& source) {
 
 bool
 PyRcode_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &rcode_type));
 }
 
diff --git a/src/lib/dns/python/rcode_python.h b/src/lib/dns/python/rcode_python.h
index 89969c7..a2de279 100644
--- a/src/lib/dns/python/rcode_python.h
+++ b/src/lib/dns/python/rcode_python.h
@@ -36,6 +36,8 @@ PyObject* createRcodeObject(const Rcode& source);
 
 /// \brief Checks if the given python object is a Rcode object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type Rcode, false otherwise
 bool PyRcode_Check(PyObject* obj);
diff --git a/src/lib/dns/python/rdata_python.cc b/src/lib/dns/python/rdata_python.cc
index 3167fca..a82fb97 100644
--- a/src/lib/dns/python/rdata_python.cc
+++ b/src/lib/dns/python/rdata_python.cc
@@ -306,6 +306,9 @@ createRdataObject(ConstRdataPtr source) {
 
 bool
 PyRdata_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &rdata_type));
 }
 
diff --git a/src/lib/dns/python/rdata_python.h b/src/lib/dns/python/rdata_python.h
index 8db6821..d3e110d 100644
--- a/src/lib/dns/python/rdata_python.h
+++ b/src/lib/dns/python/rdata_python.h
@@ -23,11 +23,6 @@ namespace isc {
 namespace dns {
 namespace python {
 
-//
-// Declaration of the custom exceptions
-// Initialization and addition of these go in the module init at the
-// end
-//
 extern PyObject* po_EmptyRdata;
 
 extern PyTypeObject rdata_type;
@@ -43,6 +38,8 @@ PyObject* createRdataObject(isc::dns::rdata::ConstRdataPtr source);
 
 /// \brief Checks if the given python object is a Rdata object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type Rdata, false otherwise
 bool PyRdata_Check(PyObject* obj);
diff --git a/src/lib/dns/python/rrclass_python.cc b/src/lib/dns/python/rrclass_python.cc
index d411896..423ab42 100644
--- a/src/lib/dns/python/rrclass_python.cc
+++ b/src/lib/dns/python/rrclass_python.cc
@@ -372,6 +372,9 @@ createRRClassObject(const RRClass& source) {
 
 bool
 PyRRClass_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &rrclass_type));
 }
 
diff --git a/src/lib/dns/python/rrclass_python.h b/src/lib/dns/python/rrclass_python.h
index f11b817..dc84cdb 100644
--- a/src/lib/dns/python/rrclass_python.h
+++ b/src/lib/dns/python/rrclass_python.h
@@ -39,6 +39,8 @@ PyObject* createRRClassObject(const RRClass& source);
 
 /// \brief Checks if the given python object is a RRClass object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type RRClass, false otherwise
 bool PyRRClass_Check(PyObject* obj);
diff --git a/src/lib/dns/python/rrset_python.cc b/src/lib/dns/python/rrset_python.cc
index a4e9d30..4ae1bae 100644
--- a/src/lib/dns/python/rrset_python.cc
+++ b/src/lib/dns/python/rrset_python.cc
@@ -405,6 +405,9 @@ createRRsetObject(const RRset& source) {
 
 bool
 PyRRset_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &rrset_type));
 }
 
diff --git a/src/lib/dns/python/rrset_python.h b/src/lib/dns/python/rrset_python.h
index 04d305f..4268678 100644
--- a/src/lib/dns/python/rrset_python.h
+++ b/src/lib/dns/python/rrset_python.h
@@ -25,11 +25,6 @@ namespace isc {
 namespace dns {
 namespace python {
 
-//
-// Declaration of the custom exceptions
-// Initialization and addition of these go in the module init at the
-// end
-//
 extern PyObject* po_EmptyRRset;
 
 extern PyTypeObject rrset_type;
@@ -45,6 +40,8 @@ PyObject* createRRsetObject(const RRset& source);
 
 /// \brief Checks if the given python object is a RRset object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type RRset, false otherwise
 bool PyRRset_Check(PyObject* obj);
diff --git a/src/lib/dns/python/rrttl_python.cc b/src/lib/dns/python/rrttl_python.cc
index 1394c0f..84610f8 100644
--- a/src/lib/dns/python/rrttl_python.cc
+++ b/src/lib/dns/python/rrttl_python.cc
@@ -324,6 +324,9 @@ createRRTTLObject(const RRTTL& source) {
 
 bool
 PyRRTTL_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &rrttl_type));
 }
 
diff --git a/src/lib/dns/python/rrttl_python.h b/src/lib/dns/python/rrttl_python.h
index ba0f5f5..f5bdb49 100644
--- a/src/lib/dns/python/rrttl_python.h
+++ b/src/lib/dns/python/rrttl_python.h
@@ -23,11 +23,6 @@ namespace isc {
 namespace dns {
 namespace python {
 
-//
-// Declaration of the custom exceptions
-// Initialization and addition of these go in the module init at the
-// end
-//
 extern PyObject* po_InvalidRRTTL;
 extern PyObject* po_IncompleteRRTTL;
 
@@ -44,6 +39,8 @@ PyObject* createRRTTLObject(const RRTTL& source);
 
 /// \brief Checks if the given python object is a RRTTL object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type RRTTL, false otherwise
 bool PyRRTTL_Check(PyObject* obj);
diff --git a/src/lib/dns/python/rrtype_python.cc b/src/lib/dns/python/rrtype_python.cc
index d3479ff..c85bf15 100644
--- a/src/lib/dns/python/rrtype_python.cc
+++ b/src/lib/dns/python/rrtype_python.cc
@@ -465,6 +465,9 @@ createRRTypeObject(const RRType& source) {
 
 bool
 PyRRType_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &rrtype_type));
 }
 
diff --git a/src/lib/dns/python/rrtype_python.h b/src/lib/dns/python/rrtype_python.h
index c251d9e..a0a1b70 100644
--- a/src/lib/dns/python/rrtype_python.h
+++ b/src/lib/dns/python/rrtype_python.h
@@ -23,11 +23,6 @@ namespace isc {
 namespace dns {
 namespace python {
 
-//
-// Declaration of the custom exceptions
-// Initialization and addition of these go in the module init at the
-// end
-//
 extern PyObject* po_InvalidRRType;
 extern PyObject* po_IncompleteRRType;
 
@@ -44,6 +39,8 @@ PyObject* createRRTypeObject(const RRType& source);
 
 /// \brief Checks if the given python object is a RRType object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type RRType, false otherwise
 bool PyRRType_Check(PyObject* obj);
diff --git a/src/lib/dns/python/tsig_python.cc b/src/lib/dns/python/tsig_python.cc
index 9cc596e..e27acde 100644
--- a/src/lib/dns/python/tsig_python.cc
+++ b/src/lib/dns/python/tsig_python.cc
@@ -37,17 +37,10 @@ using namespace isc::util::python;
 using namespace isc::dns;
 using namespace isc::dns::python;
 
-//
-// Definition of the classes
-//
-
 // For each class, we need a struct, a helper functions (init, destroy,
 // and static wrappers around the methods we export), a list of methods,
 // and a type description
 
-//
-// TSIGContext
-//
 namespace {
 // The s_* Class simply covers one instantiation of the object
 class s_TSIGContext : public PyObject {
@@ -366,6 +359,9 @@ initModulePart_TSIGContext(PyObject* mod) {
 
 bool
 PyTSIGContext_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &tsigcontext_type));
 }
 
diff --git a/src/lib/dns/python/tsig_python.h b/src/lib/dns/python/tsig_python.h
index 9be92bb..b76002d 100644
--- a/src/lib/dns/python/tsig_python.h
+++ b/src/lib/dns/python/tsig_python.h
@@ -30,6 +30,8 @@ extern PyObject* po_TSIGContextError;
 
 /// \brief Checks if the given python object is a TSIGContext object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type TSIGContext, false otherwise
 bool PyTSIGContext_Check(PyObject* obj);
diff --git a/src/lib/dns/python/tsig_rdata_python.cc b/src/lib/dns/python/tsig_rdata_python.cc
index ee316e0..858bee1 100644
--- a/src/lib/dns/python/tsig_rdata_python.cc
+++ b/src/lib/dns/python/tsig_rdata_python.cc
@@ -33,20 +33,12 @@ using namespace isc::dns;
 using namespace isc::dns::rdata;
 using namespace isc::dns::python;
 
-//
-// Definition of the classes
-//
-
 // For each class, we need a struct, a helper functions (init, destroy,
 // and static wrappers around the methods we export), a list of methods,
 // and a type description
 
-//
-// TSIG RDATA
-//
-
 namespace {
-    // The s_* Class simply covers one instantiation of the object
+// The s_* Class simply covers one instantiation of the object
 class s_TSIG : public PyObject {
 public:
     s_TSIG() : cppobj(NULL) {};
@@ -374,6 +366,9 @@ createTSIGObject(const any::TSIG& source) {
 
 bool
 PyTSIG_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &tsig_type));
 }
 
diff --git a/src/lib/dns/python/tsig_rdata_python.h b/src/lib/dns/python/tsig_rdata_python.h
index cb39317..a84d9e8 100644
--- a/src/lib/dns/python/tsig_rdata_python.h
+++ b/src/lib/dns/python/tsig_rdata_python.h
@@ -40,6 +40,8 @@ PyObject* createTSIGObject(const rdata::any::TSIG& source);
 
 /// \brief Checks if the given python object is a TSIG object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type TSIG, false otherwise
 bool PyTSIG_Check(PyObject* obj);
diff --git a/src/lib/dns/python/tsigerror_python.cc b/src/lib/dns/python/tsigerror_python.cc
index ba22c05..93dfbe8 100644
--- a/src/lib/dns/python/tsigerror_python.cc
+++ b/src/lib/dns/python/tsigerror_python.cc
@@ -30,18 +30,10 @@ using namespace isc::util::python;
 using namespace isc::dns;
 using namespace isc::dns::python;
 
-//
-// Definition of the classes
-//
-
 // For each class, we need a struct, a helper functions (init, destroy,
 // and static wrappers around the methods we export), a list of methods,
 // and a type description
 
-//
-// TSIGError
-//
-
 // Import pydoc text
 #include "tsigerror_python_inc.cc"
 
diff --git a/src/lib/dns/python/tsigkey_python.cc b/src/lib/dns/python/tsigkey_python.cc
index 8962bca..b453ae9 100644
--- a/src/lib/dns/python/tsigkey_python.cc
+++ b/src/lib/dns/python/tsigkey_python.cc
@@ -31,10 +31,6 @@ using namespace isc::util::python;
 using namespace isc::dns;
 using namespace isc::dns::python;
 
-//
-// Definition of the classes
-//
-
 // For each class, we need a struct, a helper functions (init, destroy,
 // and static wrappers around the methods we export), a list of methods,
 // and a type description
@@ -284,6 +280,9 @@ initModulePart_TSIGKey(PyObject* mod) {
 
 bool
 PyTSIGKey_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &tsigkey_type));
 }
 
@@ -304,11 +303,8 @@ PyTSIGKey_ToTSIGKey(const PyObject* tsigkey_obj) {
 // TSIGKeyRing
 //
 
-// The s_* Class simply covers one instantiation of the object
-
-// The s_* Class simply covers one instantiation of the object
-
 namespace {
+// The s_* Class simply covers one instantiation of the object
 class s_TSIGKeyRing : public PyObject {
 public:
     s_TSIGKeyRing() : cppobj(NULL) {};
@@ -521,6 +517,9 @@ initModulePart_TSIGKeyRing(PyObject* mod) {
 
 bool
 PyTSIGKeyRing_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &tsigkeyring_type));
 }
 
diff --git a/src/lib/dns/python/tsigkey_python.h b/src/lib/dns/python/tsigkey_python.h
index a634f4f..1807f54 100644
--- a/src/lib/dns/python/tsigkey_python.h
+++ b/src/lib/dns/python/tsigkey_python.h
@@ -28,6 +28,8 @@ extern PyTypeObject tsigkeyring_type;
 
 /// \brief Checks if the given python object is a TSIGKey object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type TSIGKey, false otherwise
 bool PyTSIGKey_Check(PyObject* obj);
diff --git a/src/lib/dns/python/tsigrecord_python.cc b/src/lib/dns/python/tsigrecord_python.cc
index c132229..947d0d9 100644
--- a/src/lib/dns/python/tsigrecord_python.cc
+++ b/src/lib/dns/python/tsigrecord_python.cc
@@ -32,10 +32,6 @@ using namespace isc::util::python;
 using namespace isc::dns;
 using namespace isc::dns::python;
 
-//
-// Definition of the classes
-//
-
 // For each class, we need a struct, a helper functions (init, destroy,
 // and static wrappers around the methods we export), a list of methods,
 // and a type description
@@ -44,8 +40,6 @@ using namespace isc::dns::python;
 // TSIGRecord
 //
 
-// Trivial constructor.
-
 namespace {
 // The s_* Class simply covers one instantiation of the object
 class s_TSIGRecord : public PyObject {
@@ -316,6 +310,9 @@ createTSIGRecordObject(const TSIGRecord& source) {
 
 bool
 PyTSIGRecord_Check(PyObject* obj) {
+    if (obj == NULL) {
+        isc_throw(PyCPPWrapperException, "obj argument NULL in typecheck");
+    }
     return (PyObject_TypeCheck(obj, &tsigrecord_type));
 }
 
diff --git a/src/lib/dns/python/tsigrecord_python.h b/src/lib/dns/python/tsigrecord_python.h
index d968c8e..9b392c3 100644
--- a/src/lib/dns/python/tsigrecord_python.h
+++ b/src/lib/dns/python/tsigrecord_python.h
@@ -36,6 +36,8 @@ PyObject* createTSIGRecordObject(const TSIGRecord& source);
 
 /// \brief Checks if the given python object is a TSIGRecord object
 ///
+/// \exception PyCPPWrapperException if obj is NULL
+///
 /// \param obj The object to check the type of
 /// \return true if the object is of type TSIGRecord, false otherwise
 bool PyTSIGRecord_Check(PyObject* obj);




More information about the bind10-changes mailing list