If `func` throws, then `ret` will never be assigned, and accessed later.

Thus we now initiailize it with None so that it will always have a
value.
This commit is contained in:
Alex Miller 2019-06-27 18:57:58 -07:00
parent 100afcd4f8
commit 40b290b7de
1 changed files with 1 additions and 0 deletions

View File

@ -264,6 +264,7 @@ def transactional(*tr_args, **tr_kwargs):
# last = start
while not committed:
ret = None
try:
ret = func(*largs, **kwargs)
tr.commit().wait()