Skip to content

Commit 552ef10

Browse files
committed
fixing exceptions in profiler!
1 parent 96b1c83 commit 552ef10

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

6.95/plugins/Code editor/pyeditor.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -392,17 +392,20 @@ def runto(self):
392392

393393

394394
def runtoprob(self):
395-
396395
try:
397396
self.path = QtCore.QFileInfo(self.filename).path()
398-
except AttributeError:
399-
pass
400-
self.path = QtCore.QFileInfo(self.filename).path()
401-
g = globals()
402-
os.chdir(str(self.path))
403-
script = str(self.codebox.text())
404-
import cProfile
405-
cProfile.run(script)
397+
self.path = QtCore.QFileInfo(self.filename).path()
398+
g = globals()
399+
os.chdir(str(self.path))
400+
script = str(self.codebox.text())
401+
import cProfile
402+
cProfile.run(script)
403+
except Exception as e:
404+
print e.__doc__
405+
print e.message
406+
else:
407+
import cProfile
408+
cProfile.run(script)
406409

407410

408411

0 commit comments

Comments
 (0)