src/eric7/DebugClients/Python/DebugClientBase.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9542
0b04348749ab
equal deleted inserted replaced
9481:0b936ff1bbb9 9482:a2bc06a54d9d
13 import contextlib 13 import contextlib
14 import fnmatch 14 import fnmatch
15 import json 15 import json
16 import os 16 import os
17 import re 17 import re
18 import runpy
18 import select 19 import select
19 import signal 20 import signal
20 import socket 21 import socket
21 import sys 22 import sys
22 import sysconfig 23 import sysconfig
528 self.mainThread.run( 529 self.mainThread.run(
529 code, self.debugMod.__dict__, debug=False, closeSession=False 530 code, self.debugMod.__dict__, debug=False, closeSession=False
530 ) 531 )
531 532
532 elif method == "RequestCoverage": 533 elif method == "RequestCoverage":
533 from coverage import Coverage 534 from coverage import Coverage # __IGNORE_WARNING_I10__
534 535
535 self.disassembly = None 536 self.disassembly = None
536 sys.argv = [] 537 sys.argv = []
537 if params["argv"] and params["argv"][0].startswith("--plugin="): 538 if params["argv"] and params["argv"][0].startswith("--plugin="):
538 # we are coverage testing an eric IDE plug-in 539 # we are coverage testing an eric IDE plug-in
574 self.cover.stop() 575 self.cover.stop()
575 self.cover.save() 576 self.cover.save()
576 577
577 elif method == "RequestProfile": 578 elif method == "RequestProfile":
578 sys.setprofile(None) 579 sys.setprofile(None)
579 import PyProfile 580 import PyProfile # __IGNORE_WARNING_I10__
580 581
581 self.disassembly = None 582 self.disassembly = None
582 sys.argv = [] 583 sys.argv = []
583 if params["argv"] and params["argv"][0].startswith("--plugin="): 584 if params["argv"] and params["argv"][0].startswith("--plugin="):
584 # we are profiling an eric IDE plug-in 585 # we are profiling an eric IDE plug-in
1937 self.debugMod.__dict__["__file__"] = self.running 1938 self.debugMod.__dict__["__file__"] = self.running
1938 sys.modules["__main__"] = self.debugMod 1939 sys.modules["__main__"] = self.debugMod
1939 if codeStr: 1940 if codeStr:
1940 code = self.__compileCommand(codeStr) 1941 code = self.__compileCommand(codeStr)
1941 elif scriptModule: 1942 elif scriptModule:
1942 import runpy
1943
1944 modName, modSpec, code = runpy._get_module_details(scriptModule) 1943 modName, modSpec, code = runpy._get_module_details(scriptModule)
1945 self.running = code.co_filename 1944 self.running = code.co_filename
1946 self.debugMod.__dict__.clear() 1945 self.debugMod.__dict__.clear()
1947 self.debugMod.__dict__.update( 1946 self.debugMod.__dict__.update(
1948 { 1947 {

eric ide

mercurial