Verify transaction is being used from the same thread that created it.
(self)
| 62 | self._tx = self._transaction[0] |
| 63 | |
| 64 | def _check_thread(self) -> None: |
| 65 | """Verify transaction is being used from the same thread that created it.""" |
| 66 | current_thread = threading.get_ident() |
| 67 | if current_thread != self._thread_id: |
| 68 | raise RuntimeError( |
| 69 | f'Transaction created in thread {self._thread_id} ' |
| 70 | f'but used in thread {current_thread}. ' |
| 71 | 'Transactions must be used from the thread that created them.' |
| 72 | ) |
| 73 | |
| 74 | def lock_ref(self, refname: str) -> None: |
| 75 | """Lock a reference in preparation for updating it. |
no outgoing calls
no test coverage detected