Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-3_40] Rename variable for clarity #59955

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions python/PyQt6/server/server.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down
20 changes: 10 additions & 10 deletions python/server/server.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down
Loading