[glom] Improve some stderr output.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Improve some stderr output.
- Date: Thu, 5 Nov 2015 22:22:07 +0000 (UTC)
commit 4e7aaea19b1385f930b893d66b783b2746256083
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Nov 3 22:14:45 2015 +0100
Improve some stderr output.
.../libglom/python_embed/pygdavalue_conversions.cc | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/glom/libglom/python_embed/pygdavalue_conversions.cc
b/glom/libglom/python_embed/pygdavalue_conversions.cc
index f75609f..af7394b 100644
--- a/glom/libglom/python_embed/pygdavalue_conversions.cc
+++ b/glom/libglom/python_embed/pygdavalue_conversions.cc
@@ -159,7 +159,15 @@ glom_pygda_value_from_pyobject(GValue* boxed, const boost::python::object& input
//std::cout << "DEBUG Dates not supported." << std::endl;
#endif
- std::cerr << G_STRFUNC << ": Unhandled python type." << std::endl;
+ PyObject* as_string = PyObject_Repr(input_c);
+ boost::python::extract<std::string> extractor_string(as_string);
+ const std::string str_as_string = extractor_string;
+ Py_XDECREF(as_string);
+
+ std::cerr << G_STRFUNC << ": Unhandled python type: object as string:" <<
+ str_as_string << std::endl;
+ std::cerr << G_STRFUNC << ": PY_MAJOR_VERSION=" << PY_MAJOR_VERSION <<
+ ", PY_VERSION_HEX=" << std::hex << PY_VERSION_HEX << std::endl;
return false; /* failed. */
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]