changeset 253:ef057c4e6aa2

Normalize exception info before extracting text (fixes issue #32) * exceptions.cc (pytave::fetch_exception_message): Ensure that ptype and pvalue are of same class before trying to extract the text. Fixes crash with Python 3.
author Abhinav Tripathi <genuinelucifer@gmail.com>
date Thu, 28 Jul 2016 14:21:14 -0700
parents 8ebebd557e15
children 3495a67296a8
files exceptions.cc
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/exceptions.cc	Thu Jul 28 12:05:05 2016 -0700
+++ b/exceptions.cc	Thu Jul 28 14:21:14 2016 -0700
@@ -52,6 +52,7 @@
 
     PyObject *ptype, *pvalue, *ptraceback;
     PyErr_Fetch (&ptype, &pvalue, &ptraceback);
+    PyErr_NormalizeException (&ptype, &pvalue, &ptraceback);
     std::string message;
 
     try