Skip to content

Commit

Permalink
about: also show compile-time vs. runtime python version (refs #54491)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 15, 2024
1 parent cac1150 commit 3aed1e2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5519,7 +5519,18 @@ void QgisApp::about()
versionString += QLatin1String( "</tr><tr>" );

// Python version
versionString += QStringLiteral( "<td>%1</td><td colspan=\"3\">%2</td>" ).arg( tr( "Python version" ), PYTHON_VERSION );
QString pythonVersion;
QgsPythonRunner::run( QStringLiteral( "import platform" ) );
QgsPythonRunner::eval( QStringLiteral( "platform.python_version()" ), pythonVersion );
if ( pythonVersion != PYTHON_VERSION )
{
versionString += QStringLiteral( "<td>%1</td><td>%2</td>" ).arg( tr( "Compiled against Python" ), PYTHON_VERSION );
versionString += QStringLiteral( "<td>%1</td><td>%2</td>" ).arg( tr( "Running against Python" ), pythonVersion );
}
else
{
versionString += QStringLiteral( "<td>%1</td><td colspan=\"3\">%2</td>" ).arg( tr( "Python version" ), PYTHON_VERSION );
}
versionString += QLatin1String( "</tr><tr>" );

// GDAL version
Expand Down

0 comments on commit 3aed1e2

Please sign in to comment.