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

Method __check_state

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

Source from the content-addressed store, hash-verified

165 opname))
166
167 def __check_state(self, opname):
168 if self._state is not TransactionState.STARTED:
169 if self._state is TransactionState.NEW:
170 raise apg_errors.InterfaceError(
171 'cannot {}; the transaction is not yet started'.format(
172 opname))
173 self.__check_state_base(opname)
174
175 async def __commit(self):
176 self.__check_state('commit')

Callers 2

__commitMethod · 0.95
__rollbackMethod · 0.95

Calls 1

__check_state_baseMethod · 0.95

Tested by

no test coverage detected