File tree Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -375,33 +375,23 @@ def savetext(self, fileName):
375375 os .chdir (str (self .path ))
376376
377377 def runto (self ):
378- try :
379- self .path = QtCore .QFileInfo (self .filename ).path ()
380- except AttributeError :
381- pass
378+ self .path = QtCore .QFileInfo (self .filename ).path ()
382379 g = globals ()
383380 os .chdir (str (self .path ))
384- os .path .join (os .path .expanduser ('~' ), os .path .expandvars (str (self .path )))
385381 script = str (self .codebox .text ())
386382 try :
387383 exec (script , g )
388384 QtGui .QCloseEvent ()
389-
390-
391385 except ImportError :
392386 os .chdir (str (self .path ))
393- os .path .join (os .path .expanduser ('~' ), os .path .expandvars (str (self .path )))
394- sys .path .append (str (self .path ))
387+ os .path .join (os .path .expanduser ('~' ),
388+ os .path .expandvars (str (self .path )))
389+ sys .path .insert (0 , str (self .path ))
395390 exec (script , g )
396391 QtGui .QCloseEvent ()
397-
398- if TypeError (QTextStream ):
399- g = globals ()
400- os .chdir (str (self .path ))
401- os .path .join (os .path .expanduser ('~' ), os .path .expandvars (str (self .path )))
402- sys .path .insert (0 , str (self .path ))
403- exec int (script )
404- QtGui .QCloseEvent ()
392+ except Exception , e :
393+ print str (e )
394+ QtGui .QCloseEvent ()
405395
406396
407397 def runtoprob (self ):
You can’t perform that action at this time.
0 commit comments