File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -594,7 +594,7 @@ def runScriptCode(self):
594
594
tmpFile = self .createTempFile ()
595
595
filename = tmpFile
596
596
597
- self .parent .pc .shell .runCommand (u"execfile( u'{0}'.encode('{1}'))"
597
+ self .parent .pc .shell .runCommand (u"exec(open( u'{0}'.encode('{1}')).read( ))"
598
598
.format (filename .replace ("\\ " , "/" ), sys .getfilesystemencoding ()))
599
599
600
600
def runSelectedCode (self ):
Original file line number Diff line number Diff line change @@ -5145,7 +5145,7 @@ void QgisApp::runScript( const QString &filePath )
5145
5145
5146
5146
mPythonUtils ->runString (
5147
5147
QString ( " import sys\n "
5148
- " execfile( \" %1\" .replace(\"\\\\\" , \" /\" ).encode(sys.getfilesystemencoding()))\n " ).arg ( filePath )
5148
+ " exec(open( \" %1\" .replace(\"\\\\\" , \" /\" ).encode(sys.getfilesystemencoding())).read( ))\n " ).arg ( filePath )
5149
5149
, tr ( " Failed to run Python script:" ), false );
5150
5150
}
5151
5151
You can’t perform that action at this time.
0 commit comments