support python 3.15

This commit is contained in:
ed 2023-12-14 10:49:10 +00:00
parent cba2e10d29
commit 46d667716e
2 changed files with 5 additions and 3 deletions

View file

@ -103,7 +103,7 @@ class U2idx(object):
uri = ""
try:
uri = "{}?mode=ro&nolock=1".format(Path(db_path).as_uri())
db = sqlite3.connect(uri, 2, uri=True, check_same_thread=False)
db = sqlite3.connect(uri, timeout=2, uri=True, check_same_thread=False)
cur = db.cursor()
cur.execute('pragma table_info("up")').fetchone()
self.log("ro: {}".format(db_path))
@ -115,7 +115,7 @@ class U2idx(object):
if not cur:
# on windows, this steals the write-lock from up2k.deferred_init --
# seen on win 10.0.17763.2686, py 3.10.4, sqlite 3.37.2
cur = sqlite3.connect(db_path, 2, check_same_thread=False).cursor()
cur = sqlite3.connect(db_path, timeout=2, check_same_thread=False).cursor()
self.log("opened {}".format(db_path))
self.cur[ptop] = cur

View file

@ -2137,7 +2137,9 @@ class Up2k(object):
self.log("ST: {}".format(msg))
def _orz(self, db_path: str) -> "sqlite3.Cursor":
c = sqlite3.connect(db_path, self.timeout, check_same_thread=False).cursor()
c = sqlite3.connect(
db_path, timeout=self.timeout, check_same_thread=False
).cursor()
# c.connection.set_trace_callback(self._trace)
return c