Commit dd86ba84 authored by Lars Kruse's avatar Lars Kruse

fixed scope issue with __SyncManager

thanks to Valerio Bellizzomi for reporting this issue
parent f2e387c8
...@@ -39,19 +39,19 @@ log = pycam.Utils.log.get_logger() ...@@ -39,19 +39,19 @@ log = pycam.Utils.log.get_logger()
try: try:
from multiprocessing.managers import SyncManager as __SyncManager from multiprocessing.managers import SyncManager as _SyncManager
except ImportError: except ImportError, msg:
pass log.debug("Failed to import multiprocessing.managers.SyncMananger: %s" % msg)
else: else:
# this class definition needs to be at the top level - for pyinstaller # this class definition needs to be at the top level - for pyinstaller
class TaskManager(__SyncManager): class TaskManager(_SyncManager):
@classmethod @classmethod
def _run_server(cls, *args): def _run_server(cls, *args):
# make sure that the server ignores SIGINT (KeyboardInterrupt) # make sure that the server ignores SIGINT (KeyboardInterrupt)
signal.signal(signal.SIGINT, signal.SIG_IGN) signal.signal(signal.SIGINT, signal.SIG_IGN)
# prevent connection errors to trigger exceptions # prevent connection errors to trigger exceptions
try: try:
__SyncManager._run_server(*args) _SyncManager._run_server(*args)
except socket.error: except socket.error:
pass pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment