DebugClients/Python3/DebugClientBase.py

changeset 3640
2bf828881e86
parent 3621
15f23ed3f216
child 3728
3fd874bf34e4
diff -r cede64100e13 -r 2bf828881e86 DebugClients/Python3/DebugClientBase.py
--- a/DebugClients/Python3/DebugClientBase.py	Tue Jun 17 19:46:24 2014 +0200
+++ b/DebugClients/Python3/DebugClientBase.py	Tue Jun 17 21:09:24 2014 +0200
@@ -559,14 +559,15 @@
                 self.debugMod.__dict__['__file__'] = sys.argv[0]
                 sys.modules['__main__'] = self.debugMod
                 res = 0
-                try:
-                    exec(open(sys.argv[0], encoding=self.__coding).read(),
-                         self.debugMod.__dict__)
-                except SystemExit as exc:
-                    res = exc.code
-                    atexit._run_exitfuncs()
-                self.writestream.flush()
-                self.progTerminated(res)
+                code = self.__compileFileSource(self.running)
+                if code:
+                    try:
+                        exec(code, self.debugMod.__dict__)
+                    except SystemExit as exc:
+                        res = exc.code
+                        atexit._run_exitfuncs()
+                    self.writestream.flush()
+                    self.progTerminated(res)
                 return
 
             if cmd == DebugProtocol.RequestProfile:

eric ide

mercurial