eric6/DebugClients/Python/DebugClientBase.py

changeset 7769
c9f64088224b
parent 7707
6abcf4275d0e
child 7775
4a1db75550bd
--- a/eric6/DebugClients/Python/DebugClientBase.py	Thu Oct 08 19:07:33 2020 +0200
+++ b/eric6/DebugClients/Python/DebugClientBase.py	Fri Oct 09 17:17:21 2020 +0200
@@ -15,11 +15,12 @@
 import traceback
 import os
 import json
-import imp
 import re
 import atexit
 import signal
 import time
+import types
+import importlib
 
 
 import DebugClientCapabilities
@@ -162,7 +163,7 @@
         self.framenr = 0
         
         # The context to run the debugged program in.
-        self.debugMod = imp.new_module('__main__')
+        self.debugMod = types.ModuleType('__main__')
         self.debugMod.__dict__['__builtins__'] = __builtins__
 
         # The list of complete lines to execute.
@@ -834,8 +835,9 @@
                             discoveryStart, top_level_dir=top_level_dir)
                 else:
                     if params["filename"]:
-                        utModule = imp.load_source(
+                        spec = importlib.util.spec_from_file_location(
                             params["testname"], params["filename"])
+                        utModule = importlib.util.module_from_spec(spec)
                     else:
                         utModule = None
                     if params["failed"]:

eric ide

mercurial