DebugClients/Python3/DebugClientBase.py

branch
6_1_x
changeset 4643
705ee8ad484f
parent 4632
ca310db386ed
child 4644
99699903c454
diff -r 9fcce00f9714 -r 705ee8ad484f DebugClients/Python3/DebugClientBase.py
--- a/DebugClients/Python3/DebugClientBase.py	Fri Jan 08 15:35:11 2016 +0100
+++ b/DebugClients/Python3/DebugClientBase.py	Fri Jan 08 22:14:39 2016 +0100
@@ -775,8 +775,8 @@
                     value = eval(
                         arg,
                         self.currentThread.getCurrentFrame().f_globals,
-                        self.currentThread.getFrameLocals(0))
-                except:
+                        self.currentThread.getFrameLocals(self.framenr))
+                    self.currentThread.storeFrameLocals(self.framenr)
                     # Report the exception and the traceback
                     try:
                         type, value, tb = sys.exc_info()
@@ -806,11 +806,11 @@
             
             if cmd == DebugProtocol.RequestExec:
                 _globals = self.currentThread.getCurrentFrame().f_globals
-                _locals = self.currentThread.getFrameLocals(0)
+                _locals = self.currentThread.getFrameLocals(self.framenr)
                 try:
                     code = compile(arg + '\n', '<stdin>', 'single')
                     exec(code, _globals, _locals)
-                except:
+                    self.currentThread.storeFrameLocals(self.framenr)
                     # Report the exception and the traceback
                     try:
                         type, value, tb = sys.exc_info()
@@ -996,6 +996,8 @@
                             _locals["sys"].stdout = __stdout
                         else:
                             exec(code, _globals, _locals)
+                        
+                        self.currentThread.storeFrameLocals(self.framenr)
                 except SystemExit as exc:
                     self.progTerminated(exc.code)
                 except:
@@ -1359,12 +1361,11 @@
                 scope = -1
         elif scope:
             dict = f.f_globals
+        elif f.f_globals is f.f_locals:
+                scope = -1
         else:
             dict = f.f_locals
             
-            if f.f_globals is f.f_locals:
-                scope = -1
-        
         varlist = [scope]
         
         if scope != -1:
@@ -1404,11 +1405,10 @@
                 scope = -1
         elif scope:
             dict = f.f_globals
+        elif f.f_globals is f.f_locals:
+                scope = -1
         else:
             dict = f.f_locals
-            
-            if f.f_globals is f.f_locals:
-                scope = -1
         
         varlist = [scope, var]
         

eric ide

mercurial