Fix error code for "database is locked"

See #2930
This commit is contained in:
Florian Bruhin 2017-10-17 15:33:50 +02:00
parent 12c9590524
commit 96bec9f9d7
2 changed files with 3 additions and 3 deletions

View File

@ -68,9 +68,9 @@ class SqliteError(SqlError):
# https://github.com/qutebrowser/qutebrowser/issues/2930
# https://github.com/qutebrowser/qutebrowser/issues/3004
environmental_errors = [
'5', # SQLITE_BUSY ("database is locked")
'8', # SQLITE_READONLY
'9', # SQLITE_LOCKED,
'13', # SQLITE_FULL,
'13', # SQLITE_FULL
]
self.environmental = error.nativeErrorCode() in environmental_errors

View File

@ -39,7 +39,7 @@ def test_sqlerror():
class TestSqliteError:
@pytest.mark.parametrize('error_code, environmental', [
('9', True), # SQLITE_LOCKED
('5', True), # SQLITE_BUSY
('19', False), # SQLITE_CONSTRAINT
])
def test_environmental(self, error_code, environmental):