DebugClients/Python3/DebugClientBase.py

branch
5_4_x
changeset 3641
8cfe4af1af36
parent 3160
209a07d7e401
diff -r 5234afd7a6d7 -r 8cfe4af1af36 DebugClients/Python3/DebugClientBase.py
--- a/DebugClients/Python3/DebugClientBase.py	Tue Jun 17 19:48:58 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