mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Fix pokedex load
with empty tables.
This commit is contained in:
parent
702b99666e
commit
adbd3b628f
1 changed files with 2 additions and 0 deletions
|
@ -213,6 +213,8 @@ def load(session, tables=[], directory=None, drop_tables=False, verbose=False, s
|
||||||
|
|
||||||
new_rows = []
|
new_rows = []
|
||||||
def insert_and_commit():
|
def insert_and_commit():
|
||||||
|
if not new_rows:
|
||||||
|
return
|
||||||
session.connection().execute(insert_stmt, new_rows)
|
session.connection().execute(insert_stmt, new_rows)
|
||||||
session.commit()
|
session.commit()
|
||||||
new_rows[:] = []
|
new_rows[:] = []
|
||||||
|
|
Loading…
Reference in a new issue