Skip to content

Commit ea8233e

Browse files
committed
Fix broken multiprocessing API in some Python versions
Check nipy/nipype#2754 for more details Fixes ai4os#95
1 parent b108b71 commit ea8233e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

deepaas/model/v2/wrapper.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,11 @@ def daemon(self, value):
365365

366366
class NonDaemonPool(multiprocessing.pool.Pool):
367367
# Based on https://stackoverflow.com/questions/6974695/
368-
Process = NonDaemonProcess
368+
def Process(self, *args, **kwds):
369+
proc = super(NonDaemonPool, self).Process(*args, **kwds)
370+
proc.__class__ = NonDaemonProcess
371+
372+
return proc
369373

370374

371375
class CancellablePool(object):

0 commit comments

Comments
 (0)