We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ad5d9d commit 83e1496Copy full SHA for 83e1496
1 file changed
byexample/init.py
@@ -708,10 +708,15 @@ def init_worker(cfg, job_num):
708
If the recreation process is thread safe (depends of the objects'
709
implementations), then init_worker is thread safe.
710
'''
711
- # let the rest of byexample for this worker to know
+ patch = {}
712
+ # Patch the job_number: let the rest of byexample for this worker to know
713
# in which worker is on
714
assert cfg['job_number'] == '__main__'
- cfg = cfg.copy(patch={'job_number': int(job_num)})
715
+ patch['job_number'] = int(job_num)
716
+
717
+ # Get an independent copy of cfg (and therefore, thread-safe)
718
+ # with some keys patched
719
+ cfg = cfg.copy(patch=patch)
720
721
concerns = ConcernComposite(**cfg)
722
0 commit comments