Jure Erznožnik
2014-11-12 14:32:18 UTC
I just installed this on Python 2.7 and immediately ran into a possible bug:
When connection.rollback() is called, a new transaction wasn't immediately started.
I traced the bug to line 382 in adodbapi.py where transaction_level is checked against 0. However, the COM routine called a bit above this line actually returns None as current level.
Adding the check for None solves the issue:
adodbapi.py
def _rollback(self):
# original statement didn't check for None
if self.transaction_level == 0 or self.transaction_level is None: # line 382
Is it possible to add this to project source / PyPI?
LP,
Jure
When connection.rollback() is called, a new transaction wasn't immediately started.
I traced the bug to line 382 in adodbapi.py where transaction_level is checked against 0. However, the COM routine called a bit above this line actually returns None as current level.
Adding the check for None solves the issue:
adodbapi.py
def _rollback(self):
# original statement didn't check for None
if self.transaction_level == 0 or self.transaction_level is None: # line 382
Is it possible to add this to project source / PyPI?
LP,
Jure