From 75758dff031fb38d1c194dec0ba7226bd3e651b6 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 17 Dec 2024 07:49:42 +1000 Subject: [PATCH] Rename variable for clarity --- python/PyQt6/server/server.sip.in | 20 ++++++++++---------- python/server/server.sip.in | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/python/PyQt6/server/server.sip.in b/python/PyQt6/server/server.sip.in index 2032ffca677f..98c1d70d23ec 100644 --- a/python/PyQt6/server/server.sip.in +++ b/python/PyQt6/server/server.sip.in @@ -21,24 +21,24 @@ ${DEFAULTDOCSTRINGSIGNATURE} PyErr_Fetch(&type, &exception, &traceback); // check whether the object is already a unicode string - QString pyStrException; + QString originalExceptionMessage; if ( PyUnicode_Check( exception) ) { - pyStrException = QString::fromUtf8( PyUnicode_AsUTF8( exception ) ); + originalExceptionMessage = QString::fromUtf8( PyUnicode_AsUTF8( exception ) ); } else { PyObject* str = PyObject_Str( exception ); - pyStrException = QString::fromUtf8( PyUnicode_AsUTF8( str ) ); + originalExceptionMessage = QString::fromUtf8( PyUnicode_AsUTF8( str ) ); Py_XDECREF( str ); } SIP_RELEASE_GIL( sipGILState ); QString strException = "API bad request error"; - if ( !pyStrException.isEmpty() ) + if ( !originalExceptionMessage.isEmpty() ) { - strException = pyStrException; + strException = originalExceptionMessage; } throw QgsServerApiBadRequestException( strException ); @@ -50,24 +50,24 @@ ${DEFAULTDOCSTRINGSIGNATURE} PyErr_Fetch(&type, &exception, &traceback); // check whether the object is already a unicode string - QString pyStrException; + QString originalExceptionMessage; if ( PyUnicode_Check( exception) ) { - pyStrException = QString::fromUtf8( PyUnicode_AsUTF8( exception ) ); + originalExceptionMessage = QString::fromUtf8( PyUnicode_AsUTF8( exception ) ); } else { PyObject* str = PyObject_Str( exception ); - pyStrException = QString::fromUtf8( PyUnicode_AsUTF8( str ) ); + originalExceptionMessage = QString::fromUtf8( PyUnicode_AsUTF8( str ) ); Py_XDECREF( str ); } SIP_RELEASE_GIL( sipGILState ); QString strException = "Server internal error"; - if ( !pyStrException.isEmpty() ) + if ( !originalExceptionMessage.isEmpty() ) { - strException = pyStrException; + strException = originalExceptionMessage; } throw QgsServerException( strException ); diff --git a/python/server/server.sip.in b/python/server/server.sip.in index 69491f1d2f07..a0c2e4abe4e0 100644 --- a/python/server/server.sip.in +++ b/python/server/server.sip.in @@ -20,24 +20,24 @@ ${DEFAULTDOCSTRINGSIGNATURE} PyErr_Fetch(&type, &exception, &traceback); // check whether the object is already a unicode string - QString pyStrException; + QString originalExceptionMessage; if ( PyUnicode_Check( exception) ) { - pyStrException = QString::fromUtf8( PyUnicode_AsUTF8( exception ) ); + originalExceptionMessage = QString::fromUtf8( PyUnicode_AsUTF8( exception ) ); } else { PyObject* str = PyObject_Str( exception ); - pyStrException = QString::fromUtf8( PyUnicode_AsUTF8( str ) ); + originalExceptionMessage = QString::fromUtf8( PyUnicode_AsUTF8( str ) ); Py_XDECREF( str ); } SIP_RELEASE_GIL( sipGILState ); QString strException = "API bad request error"; - if ( !pyStrException.isEmpty() ) + if ( !originalExceptionMessage.isEmpty() ) { - strException = pyStrException; + strException = originalExceptionMessage; } throw QgsServerApiBadRequestException( strException ); @@ -49,24 +49,24 @@ ${DEFAULTDOCSTRINGSIGNATURE} PyErr_Fetch(&type, &exception, &traceback); // check whether the object is already a unicode string - QString pyStrException; + QString originalExceptionMessage; if ( PyUnicode_Check( exception) ) { - pyStrException = QString::fromUtf8( PyUnicode_AsUTF8( exception ) ); + originalExceptionMessage = QString::fromUtf8( PyUnicode_AsUTF8( exception ) ); } else { PyObject* str = PyObject_Str( exception ); - pyStrException = QString::fromUtf8( PyUnicode_AsUTF8( str ) ); + originalExceptionMessage = QString::fromUtf8( PyUnicode_AsUTF8( str ) ); Py_XDECREF( str ); } SIP_RELEASE_GIL( sipGILState ); QString strException = "Server internal error"; - if ( !pyStrException.isEmpty() ) + if ( !originalExceptionMessage.isEmpty() ) { - strException = pyStrException; + strException = originalExceptionMessage; } throw QgsServerException( strException );