[glom] glom_pygda_value_from_pyobject(): Handle Py_None explicitly.



commit a53a07f6c5fe7e14ca7931ceeaf127f78f7bf8e6
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Nov 3 22:32:20 2015 +0100

    glom_pygda_value_from_pyobject(): Handle Py_None explicitly.

 .../libglom/python_embed/pygdavalue_conversions.cc |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/glom/libglom/python_embed/pygdavalue_conversions.cc 
b/glom/libglom/python_embed/pygdavalue_conversions.cc
index af7394b..78f9f6d 100644
--- a/glom/libglom/python_embed/pygdavalue_conversions.cc
+++ b/glom/libglom/python_embed/pygdavalue_conversions.cc
@@ -44,6 +44,12 @@ glom_pygda_value_from_pyobject(GValue* boxed, const boost::python::object& input
       g_value_unset(boxed);
       
     auto input_c = input.ptr();
+
+    if(input_c == Py_None)
+    {
+      std::cerr << G_STRFUNC << ": Returning false for Py_None" << std::endl;
+      return false;
+    }
     
     //We check for bool first, 
     //because bool is derived from int in Python,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]