Skip to content

Commit ae640a9

Browse files
authored
Merge pull request #103 from nick13jaremek/fix/atexit-cleanup-condition
Added conditional check on 'atexit' event function: the Python interp…
2 parents eac9883 + 5d595a1 commit ae640a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scraperwiki/sql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def commit_transactions():
123123
"""
124124
Ensure any outstanding transactions are committed on exit
125125
"""
126-
if _State._transaction is not None:
126+
if _State is not None and _State._transaction is not None:
127127
_State._transaction.commit()
128128
_State._transaction = None
129129

0 commit comments

Comments
 (0)