Commits

Anthony Tuininga committed 2cf52b3

Normalize the exception prior to working with it in order to avoid traceback
errors on Python 3.

Comments (0)

Files changed (1)

source/bases/Win32GUI.c

 
     // create caption and message objects
     PyErr_Fetch(&type, &value, &traceback);
+    PyErr_NormalizeException(&type, &value, &traceback);
     contextMessageObj = cxString_FromAscii(contextMessage);
     if (!contextMessageObj)
         return FatalError("Cannot create context message string object.");
     int exitCode = 0;
 
     PyErr_Fetch(&type, &value, &traceback);
+    PyErr_NormalizeException(&type, &value, &traceback);
     caption = PyObject_GetAttrString(value, "caption");
     if (!caption || !cxString_Check(caption)) {
         PyErr_Clear();
 
     // get the exception details
     PyErr_Fetch(&type, &value, &traceback);
+    PyErr_NormalizeException(&type, &value, &traceback);
     argsTuple = PyTuple_New(3);
     if (!argsTuple)
         return FatalPythonErrorNoTraceback(value, "Cannot create args tuple.");