()
| 599 | |
| 600 | Raises: |
| 601 | ValueError: if the current thread id does not match the global context stack thread id. |
| 602 | """ |
| 603 | current_thread_id = threading.get_ident() |
| 604 | if _global_context_stack.thread_id == current_thread_id: |
| 605 | raise ValueError("install_context_stack should only be called on a different thread") |
| 606 | _global_context_stack.thread_id = current_thread_id |
| 607 | _global_context_stack.stack = stack |
no outgoing calls