GitLab will be upgraded on June 23rd evening. During the upgrade the service will be unavailable, sorry for the inconvenience.

Commit 2bd50e76 authored by Wout De Nolf's avatar Wout De Nolf

Edna2Pool does not work under python 3.8

parent fe3637d2
......@@ -69,29 +69,37 @@ def trace_unhandled_exceptions(func):
#############################################################################
# Create no daemon processes
# See : https://stackoverflow.com/a/8963618
# See : https://stackoverflow.com/a/53180921
#
class NoDaemonProcess(multiprocessing.Process):
# make 'daemon' attribute always return False
def _get_daemon(self):
@property
def daemon(self):
return False
def _set_daemon(self, value):
@daemon.setter
def daemon(self, value):
pass
daemon = property(_get_daemon, _set_daemon)
# We sub-class multiprocessing.pool.Pool instead of multiprocessing.Pool
# because the latter is only a wrapper function, not a proper class.
class NoDaemonContext(type(multiprocessing.get_context())):
Process = NoDaemonProcess
# We sub-class multiprocessing.pool.Pool instead of multiprocessing.Pool
# because the latter is only a wrapper function, not a proper class.
class Edna2Pool(multiprocessing.pool.Pool):
Process = NoDaemonProcess
def __init__(self, *args, **kwargs):
kwargs["context"] = NoDaemonContext()
super().__init__(*args, **kwargs)
#
#
#############################################################################
class AsyncFactory:
def __init__(self, func, callback=None, errorCallback=None):
self.func = func
......
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