From ea2b6ee94506afde65948f3d97ee1705096908fa Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Tue, 9 May 2017 00:13:05 +0200 Subject: [PATCH] pytools fix --- src/Base/PyTools.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Base/PyTools.c b/src/Base/PyTools.c index 200f792a0c..39511cbe37 100644 --- a/src/Base/PyTools.c +++ b/src/Base/PyTools.c @@ -267,12 +267,14 @@ void PP_Fetch_Error_Text() if (errdata != NULL && (PyDict_Check(errdata)) ) /* str() increfs */ { - /* pystring = PyDict_GetItemString(errdata,"swhat"); - strncpy(PP_last_error_info, PyString_AsString(pystring), MAX); - PP_last_error_info[MAX-1] = '\0'; - pystring = PyDict_GetItemString(errdata,"sfile"); + if(pystring!=NULL) { + strncpy(PP_last_error_info, PyString_AsString(pystring), MAX); + PP_last_error_info[MAX-1] = '\0'; + } + + /*pystring = PyDict_GetItemString(errdata,"sfile"); strncpy(PP_last_error_file, PyString_AsString(pystring), MAX); PP_last_error_file[MAX-1] = '\0';