Message162525
| Author |
sbt |
| Recipients |
cool-RR, sbt |
| Date |
2012年06月08日.12:46:21 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1339159582.81.0.275914203524.issue8289@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
As long as you don't pass the arguments on to Process.__init__() when you call it there should be no problem.
The following program works, but will fail with RuntimeError if you uncomment the comment line:
from multiprocessing import Process
class Unpicklable(object):
def __reduce__(self):
raise RuntimeError
class MyProcess(Process):
def __init__(self, foo, unpicklable_bar):
Process.__init__(self,
#args=(foo, unpicklable_bar)
)
self.foo = foo
self.baz = str(unpicklable_bar)
def run(self):
print(self.foo)
print(self.baz)
if __name__ == '__main__':
p = MyProcess([1,2,3], Unpicklable())
p.start()
p.join() |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年06月08日 12:46:22 | sbt | set | recipients:
+ sbt, cool-RR |
| 2012年06月08日 12:46:22 | sbt | set | messageid: <1339159582.81.0.275914203524.issue8289@psf.upfronthosting.co.za> |
| 2012年06月08日 12:46:22 | sbt | link | issue8289 messages |
| 2012年06月08日 12:46:21 | sbt | create |
|