Skip to content

Commit 6667b0e

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

deepaas/model/v2/wrapper.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,11 @@ def daemon(self, value):
396396

397397
class NonDaemonPool(multiprocessing.pool.Pool):
398398
# Based on https://stackoverflow.com/questions/6974695/
399-
Process = NonDaemonProcess
399+
def Process(self, *args, **kwds):
400+
proc = super(NonDaemonPool, self).Process(*args, **kwds)
401+
proc.__class__ = NonDaemonProcess
402+
403+
return proc
400404

401405

402406
class CancellablePool(object):

0 commit comments

Comments
 (0)