eric6/DebugClients/Python/DebugClientBase.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8142
43248bafe9b2
parent 8159
08b8b3d2deb1
child 8273
698ae46f40a4
equal deleted inserted replaced
8153:e01ae92db699 8176:31965986ecd1
624 frmnr -= 1 624 frmnr -= 1
625 _globals = cf.f_globals 625 _globals = cf.f_globals
626 _locals = ( 626 _locals = (
627 self.currentThread.getFrameLocals( 627 self.currentThread.getFrameLocals(
628 self.framenr)) 628 self.framenr))
629 # transfer all locals into a new globals
630 # to emulate Python scoping rules
631 _updatedGlobals = {}
632 _updatedGlobals.update(_globals)
633 _updatedGlobals.update(_locals)
629 #- reset sys.stdout to our redirector 634 #- reset sys.stdout to our redirector
630 #- (unconditionally) 635 #- (unconditionally)
631 if "sys" in _globals: 636 if "sys" in _globals:
632 __stdout = _globals["sys"].stdout 637 __stdout = _updatedGlobals["sys"].stdout
633 _globals["sys"].stdout = self.writestream 638 _updatedGlobals["sys"].stdout = (
634 exec(code, _globals, _locals) # secok 639 self.writestream
635 _globals["sys"].stdout = __stdout 640 )
641 exec(code, _updatedGlobals, _locals) # secok
642 _updatedGlobals["sys"].stdout = __stdout
636 elif "sys" in _locals: 643 elif "sys" in _locals:
637 __stdout = _locals["sys"].stdout 644 __stdout = _locals["sys"].stdout
638 _locals["sys"].stdout = self.writestream 645 _locals["sys"].stdout = self.writestream
639 exec(code, _globals, _locals) # secok 646 exec(code, _updatedGlobals, _locals) # secok
640 _locals["sys"].stdout = __stdout 647 _locals["sys"].stdout = __stdout
641 else: 648 else:
642 exec(code, _globals, _locals) # secok 649 exec(code, _updatedGlobals, _locals) # secok
643 650
644 self.currentThread.storeFrameLocals(self.framenr) 651 self.currentThread.storeFrameLocals(self.framenr)
645 except SystemExit as exc: 652 except SystemExit as exc:
646 self.progTerminated(exc.code) 653 self.progTerminated(exc.code)
647 except Exception: 654 except Exception:

eric ide

mercurial