mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-11 11:46:02 +00:00
Fix NameError
This commit is contained in:
parent
09dacde3f3
commit
83531f95e5
1 changed files with 3 additions and 0 deletions
|
|
@ -27,11 +27,14 @@ sync_logger = logging.getLogger(__name__)
|
|||
|
||||
@contextlib.contextmanager
|
||||
def _exclusive_transaction(conn):
|
||||
c = None
|
||||
try:
|
||||
c = conn.execute('BEGIN EXCLUSIVE TRANSACTION')
|
||||
yield c
|
||||
c.execute('COMMIT')
|
||||
except BaseException:
|
||||
if c is None:
|
||||
raise
|
||||
_, e, tb = sys.exc_info()
|
||||
c.execute('ROLLBACK')
|
||||
raise e.with_traceback(tb)
|
||||
|
|
|
|||
Loading…
Reference in a new issue