MCPcopy Index your code
hub / github.com/MagicStack/asyncpg / __check_state_base

Method __check_state_base

asyncpg/transaction.py:153–165  ·  view source on GitHub ↗
(self, opname)

Source from the content-addressed store, hash-verified

151 self._state = TransactionState.STARTED
152
153 def __check_state_base(self, opname):
154 if self._state is TransactionState.COMMITTED:
155 raise apg_errors.InterfaceError(
156 'cannot {}; the transaction is already committed'.format(
157 opname))
158 if self._state is TransactionState.ROLLEDBACK:
159 raise apg_errors.InterfaceError(
160 'cannot {}; the transaction is already rolled back'.format(
161 opname))
162 if self._state is TransactionState.FAILED:
163 raise apg_errors.InterfaceError(
164 'cannot {}; the transaction is in error state'.format(
165 opname))
166
167 def __check_state(self, opname):
168 if self._state is not TransactionState.STARTED:

Callers 2

startMethod · 0.95
__check_stateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected