Skip to content

Commit

Permalink
gaurd against sqlite transaction bug in py36
Browse files Browse the repository at this point in the history
  • Loading branch information
perrygeo committed May 2, 2017
1 parent 035ee72 commit b5c0c46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: python
python:
- 2.6
- 2.7
- 3.6
install:
- pip install nose
script:
Expand Down
6 changes: 6 additions & 0 deletions mbutil/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ def optimize_database(cur, silent):
cur.execute("""ANALYZE;""")
if not silent:
logger.debug('cleaning db')

# Workaround for python>=3.6.0,python<3.6.2
# https://bugs.python.org/issue28518
cur.isolation_level = None
cur.execute("""VACUUM;""")
cur.isolation_level = '' # reset default value of isolation_level


def compression_do(cur, con, chunk, silent):
if not silent:
Expand Down

0 comments on commit b5c0c46

Please sign in to comment.