Skip to content

Commit

Permalink
add fallback for missing WITHOUT ROWID support (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jan 3, 2020
1 parent 87c8b89 commit 025f6e3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions gallery_dl/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,15 @@ def __init__(self, path, extractor):
con.isolation_level = None
self.close = con.close
self.cursor = con.cursor()
self.cursor.execute("CREATE TABLE IF NOT EXISTS archive "
"(entry PRIMARY KEY) WITHOUT ROWID")

try:
self.cursor.execute("CREATE TABLE IF NOT EXISTS archive "
"(entry PRIMARY KEY) WITHOUT ROWID")
except sqlite3.OperationalError:
# fallback for missing WITHOUT ROWID support (#553)
self.cursor.execute("CREATE TABLE IF NOT EXISTS archive "
"(entry PRIMARY KEY)")

self.keygen = (extractor.category + extractor.config(
"archive-format", extractor.archive_fmt)
).format_map
Expand Down

0 comments on commit 025f6e3

Please sign in to comment.