Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/joblib/externals/loky/backend/__init__.py: 75%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

8 statements  

1import os 

2from multiprocessing import synchronize 

3 

4from .context import get_context 

5 

6 

7def _make_name(): 

8 return f"/loky-{os.getpid()}-{next(synchronize.SemLock._rand)}" 

9 

10 

11# monkey patch the name creation for multiprocessing 

12synchronize.SemLock._make_name = staticmethod(_make_name) 

13 

14__all__ = ["get_context"]