Skip to content

Commit c458a53

Browse files
authored
Merge pull request #9541 from qgis/backport-9537-on-release-3_6
Backport #9537 on release-3_6
2 parents 4e5888d + 4a36874 commit c458a53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ int main( int argc, char *argv[] )
13861386
//replace backslashes with forward slashes
13871387
pythonfile.replace( '\\', '/' );
13881388
#endif
1389-
QgsPythonRunner::run( QStringLiteral( "exec(open('%1').read())" ).arg( pythonfile ) );
1389+
QgsPythonRunner::run( QStringLiteral( "with open('%1','r') as f: exec(f.read())" ).arg( pythonfile ) );
13901390
}
13911391

13921392
/////////////////////////////////`////////////////////////////////////

0 commit comments

Comments
 (0)