gh-100408: Fix a traceback in multiprocessing example (#100409)

This commit is contained in:
Serhiy Storchaka 2023-04-05 14:43:26 +03:00 committed by GitHub
parent 3246688918
commit a28d4edb23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -460,16 +460,16 @@ process which created it.
... return x*x
...
>>> with p:
... p.map(f, [1,2,3])
... p.map(f, [1,2,3])
Process PoolWorker-1:
Process PoolWorker-2:
Process PoolWorker-3:
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
AttributeError: 'module' object has no attribute 'f'
AttributeError: 'module' object has no attribute 'f'
AttributeError: 'module' object has no attribute 'f'
AttributeError: Can't get attribute 'f' on <module '__main__' (<class '_frozen_importlib.BuiltinImporter'>)>
AttributeError: Can't get attribute 'f' on <module '__main__' (<class '_frozen_importlib.BuiltinImporter'>)>
AttributeError: Can't get attribute 'f' on <module '__main__' (<class '_frozen_importlib.BuiltinImporter'>)>
(If you try this it will actually output three full tracebacks
interleaved in a semi-random fashion, and then you may have to