From e5f7ea205c6201e364464a093efd3d5044dd23b6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 23 May 2022 17:58:11 +0200 Subject: [PATCH] GH-93115: Fix version check in sqlite3 module constants test (GH-93116) (cherry picked from commit d5f0dd160011826f0196d220aefc29d2ce497428) Co-authored-by: Florian Bruhin --- Lib/test/test_sqlite3/test_dbapi.py | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py index a7783f30663694..e514adb35eec1d 100644 --- a/Lib/test/test_sqlite3/test_dbapi.py +++ b/Lib/test/test_sqlite3/test_dbapi.py @@ -228,7 +228,7 @@ def test_module_constants(self): "SQLITE_READONLY_CANTLOCK", "SQLITE_READONLY_RECOVERY", ] - if sqlite.version_info >= (3, 7, 16): + if sqlite.sqlite_version_info >= (3, 7, 16): consts += [ "SQLITE_CONSTRAINT_CHECK", "SQLITE_CONSTRAINT_COMMITHOOK", @@ -241,63 +241,63 @@ def test_module_constants(self): "SQLITE_CONSTRAINT_VTAB", "SQLITE_READONLY_ROLLBACK", ] - if sqlite.version_info >= (3, 7, 17): + if sqlite.sqlite_version_info >= (3, 7, 17): consts += [ "SQLITE_IOERR_MMAP", "SQLITE_NOTICE_RECOVER_ROLLBACK", "SQLITE_NOTICE_RECOVER_WAL", ] - if sqlite.version_info >= (3, 8, 0): + if sqlite.sqlite_version_info >= (3, 8, 0): consts += [ "SQLITE_BUSY_SNAPSHOT", "SQLITE_IOERR_GETTEMPPATH", "SQLITE_WARNING_AUTOINDEX", ] - if sqlite.version_info >= (3, 8, 1): + if sqlite.sqlite_version_info >= (3, 8, 1): consts += ["SQLITE_CANTOPEN_CONVPATH", "SQLITE_IOERR_CONVPATH"] - if sqlite.version_info >= (3, 8, 2): + if sqlite.sqlite_version_info >= (3, 8, 2): consts.append("SQLITE_CONSTRAINT_ROWID") - if sqlite.version_info >= (3, 8, 3): + if sqlite.sqlite_version_info >= (3, 8, 3): consts.append("SQLITE_READONLY_DBMOVED") - if sqlite.version_info >= (3, 8, 7): + if sqlite.sqlite_version_info >= (3, 8, 7): consts.append("SQLITE_AUTH_USER") - if sqlite.version_info >= (3, 9, 0): + if sqlite.sqlite_version_info >= (3, 9, 0): consts.append("SQLITE_IOERR_VNODE") - if sqlite.version_info >= (3, 10, 0): + if sqlite.sqlite_version_info >= (3, 10, 0): consts.append("SQLITE_IOERR_AUTH") - if sqlite.version_info >= (3, 14, 1): + if sqlite.sqlite_version_info >= (3, 14, 1): consts.append("SQLITE_OK_LOAD_PERMANENTLY") - if sqlite.version_info >= (3, 21, 0): + if sqlite.sqlite_version_info >= (3, 21, 0): consts += [ "SQLITE_IOERR_BEGIN_ATOMIC", "SQLITE_IOERR_COMMIT_ATOMIC", "SQLITE_IOERR_ROLLBACK_ATOMIC", ] - if sqlite.version_info >= (3, 22, 0): + if sqlite.sqlite_version_info >= (3, 22, 0): consts += [ "SQLITE_ERROR_MISSING_COLLSEQ", "SQLITE_ERROR_RETRY", "SQLITE_READONLY_CANTINIT", "SQLITE_READONLY_DIRECTORY", ] - if sqlite.version_info >= (3, 24, 0): + if sqlite.sqlite_version_info >= (3, 24, 0): consts += ["SQLITE_CORRUPT_SEQUENCE", "SQLITE_LOCKED_VTAB"] - if sqlite.version_info >= (3, 25, 0): + if sqlite.sqlite_version_info >= (3, 25, 0): consts += ["SQLITE_CANTOPEN_DIRTYWAL", "SQLITE_ERROR_SNAPSHOT"] - if sqlite.version_info >= (3, 31, 0): + if sqlite.sqlite_version_info >= (3, 31, 0): consts += [ "SQLITE_CANTOPEN_SYMLINK", "SQLITE_CONSTRAINT_PINNED", "SQLITE_OK_SYMLINK", ] - if sqlite.version_info >= (3, 32, 0): + if sqlite.sqlite_version_info >= (3, 32, 0): consts += [ "SQLITE_BUSY_TIMEOUT", "SQLITE_CORRUPT_INDEX", "SQLITE_IOERR_DATA", ] - if sqlite.version_info >= (3, 34, 0): - const.append("SQLITE_IOERR_CORRUPTFS") + if sqlite.sqlite_version_info >= (3, 34, 0): + consts.append("SQLITE_IOERR_CORRUPTFS") for const in consts: with self.subTest(const=const): self.assertTrue(hasattr(sqlite, const))