Acquires then releases the module lock for a given module name. This is used to ensure a module is completely initialized, in the event it is being imported by another thread.
(name)
| 464 | |
| 465 | |
| 466 | def _lock_unlock_module(name): |
| 467 | """Acquires then releases the module lock for a given module name. |
| 468 | |
| 469 | This is used to ensure a module is completely initialized, in the |
| 470 | event it is being imported by another thread. |
| 471 | """ |
| 472 | lock = _get_module_lock(name) |
| 473 | try: |
| 474 | lock.acquire() |
| 475 | except _DeadlockError: |
| 476 | # Concurrent circular import, we'll accept a partially initialized |
| 477 | # module object. |
| 478 | pass |
| 479 | else: |
| 480 | lock.release() |
| 481 | |
| 482 | # Frame stripping magic ############################################### |
| 483 | def _call_with_frames_removed(f, *args, **kwds): |
no test coverage detected
searching dependent graphs…