core/sqlite: add compat version for backup() for python3.6
This commit is contained in:
parent
f09ca17560
commit
b94120deaf
2 changed files with 19 additions and 2 deletions
|
@ -45,6 +45,7 @@ def sqlite_copy_and_open(db: PathIsh) -> sqlite3.Connection:
|
|||
tocopy = [dp] + [p for p in dp.parent.glob(dp.name + '-*') if not p.name.endswith('-shm')]
|
||||
for p in tocopy:
|
||||
shutil.copy(p, tdir / p.name)
|
||||
with sqlite3.connect(tdir / dp.name) as conn:
|
||||
conn.backup(dest)
|
||||
with sqlite3.connect(str(tdir / dp.name)) as conn:
|
||||
from .compat import sqlite_backup
|
||||
sqlite_backup(source=conn, dest=dest)
|
||||
return dest
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue