diff --git a/src/Base/PyTools.c b/src/Base/PyTools.c index 65293202a8..7a6a705a58 100644 --- a/src/Base/PyTools.c +++ b/src/Base/PyTools.c @@ -271,9 +271,9 @@ void PP_Fetch_Error_Text() if (value!=NULL) { #if PY_MAJOR_VERSION < 3 - strncpy(PP_last_error_info, PyString_AsString(pystring), MAX); + strncpy(PP_last_error_info, PyString_AsString(value), MAX); #else - strncpy(PP_last_error_info, PyUnicode_AsUTF8(pystring), MAX); + strncpy(PP_last_error_info, PyUnicode_AsUTF8(value), MAX); #endif PP_last_error_info[MAX-1] = '\0'; }