@@ -406,7 +406,7 @@ def delete(self, verbose=True):
406
406
print ('About to delete:' )
407
407
408
408
if not already_in_transaction :
409
- self . connection .start_transaction ()
409
+ conn .start_transaction ()
410
410
total = 0
411
411
try :
412
412
for name , table in reversed (list (delete_list .items ())):
@@ -418,25 +418,25 @@ def delete(self, verbose=True):
418
418
except :
419
419
# Delete failed, perhaps due to insufficient privileges. Cancel transaction.
420
420
if not already_in_transaction :
421
- self . connection .cancel_transaction ()
421
+ conn .cancel_transaction ()
422
422
raise
423
423
else :
424
424
assert not (already_in_transaction and safe )
425
425
if not total :
426
426
print ('Nothing to delete' )
427
427
if not already_in_transaction :
428
- self . connection .cancel_transaction ()
428
+ conn .cancel_transaction ()
429
429
else :
430
430
if already_in_transaction :
431
431
if verbose :
432
432
print ('The delete is pending within the ongoing transaction.' )
433
433
else :
434
434
if not safe or user_choice ("Proceed?" , default = 'no' ) == 'yes' :
435
- self . connection .commit_transaction ()
435
+ conn .commit_transaction ()
436
436
if verbose or safe :
437
437
print ('Committed.' )
438
438
else :
439
- self . connection .cancel_transaction ()
439
+ conn .cancel_transaction ()
440
440
if verbose or safe :
441
441
print ('Cancelled deletes.' )
442
442
0 commit comments