src/eric7/Utilities/BackgroundClient.py

branch
eric7
changeset 9485
0f3620304d7a
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
equal deleted inserted replaced
9484:d2eb8f0a5bf0 9485:0f3620304d7a
8 Module implementing a Qt free version of a background client for the various 8 Module implementing a Qt free version of a background client for the various
9 checkers and other python interpreter dependent functions. 9 checkers and other python interpreter dependent functions.
10 """ 10 """
11 11
12 import contextlib 12 import contextlib
13 import importlib
13 import io 14 import io
14 import json 15 import json
15 import multiprocessing 16 import multiprocessing
16 import socket 17 import socket
17 import struct 18 import struct
60 @return text result of the import action 61 @return text result of the import action
61 @rtype str 62 @rtype str
62 """ 63 """
63 sys.path.insert(1, path) 64 sys.path.insert(1, path)
64 try: 65 try:
65 importedModule = __import__(module, globals(), locals(), [], 0) 66 importedModule = importlib.import_module(module)
66 self.services[fn] = importedModule.initService() 67 self.services[fn] = importedModule.initService()
67 with contextlib.suppress(AttributeError): 68 with contextlib.suppress(AttributeError):
68 self.batchServices["batch_" + fn] = importedModule.initBatchService() 69 self.batchServices["batch_" + fn] = importedModule.initBatchService()
69 return "ok" 70 return "ok"
70 except ImportError as err: 71 except ImportError as err:

eric ide

mercurial