Python Glossary Русский

all Python 3until 3.14sqlite3term

sqlite3.version_info

removed

The sqlite3 module version as a tuple, not the SQLite version. Removed in Python 3.14 — use sqlite3.sqlite_version_info.

Syntax

sqlite3.version_info  # до 3.14

The tuple (2, 6, 0) is the same frozen pysqlite wrapper version as sqlite3.version, only as numbers. People used it to check for SQLite features, and the check always lied; it was removed together with the string. To migrate, replace sqlite3.version_info with sqlite3.sqlite_version_info, the version tuple of the real library. A feature check looks like if sqlite3.sqlite_version_info >= (3, 35, 0): — from that version SQLite understands RETURNING.

Examples

# Python 3.14+
import sqlite3
try:
    sqlite3.version_info
except AttributeError as e:
    print(type(e).__name__)  # → AttributeError
# Python 3.14+
import sqlite3
print(len(sqlite3.sqlite_version_info))  # → 3
print(sqlite3.sqlite_version_info >= (3, 7, 15))  # → True
import sqlite3
print(sqlite3.version_info)  # → (2, 6, 0)

See also

Common errors

Open in the full glossarydocs.python.orgReport an inaccuracy