Mercurial > p > roundup > code
comparison roundup/backends/back_sqlite.py @ 8081:95f91b6f0386
issue2551343 - Remove support for PySQLite and sqlite v2.
It is unmaintained and sqlite3 is used which is the default for a
Python distribution.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 13 Jul 2024 18:52:55 -0400 |
| parents | e3975f679bf1 |
| children |
comparison
equal
deleted
inserted
replaced
| 8080:d1c29284ccd9 | 8081:95f91b6f0386 |
|---|---|
| 29 sqlite_version = None | 29 sqlite_version = None |
| 30 try: | 30 try: |
| 31 import sqlite3 as sqlite | 31 import sqlite3 as sqlite |
| 32 sqlite_version = 3 | 32 sqlite_version = 3 |
| 33 except ImportError: | 33 except ImportError: |
| 34 try: | 34 raise ValueError("Unable to import sqlite3.") |
| 35 from pysqlite2 import dbapi2 as sqlite | |
| 36 if sqlite.version_info < (2, 1, 0): | |
| 37 raise ValueError('pysqlite2 minimum version is 2.1.0+ ' | |
| 38 '- %s found' % sqlite.version) | |
| 39 sqlite_version = 2 | |
| 40 except ImportError: | |
| 41 raise ValueError("Unable to import sqlite3 or sqlite 2.") | |
| 42 | 35 |
| 43 | 36 |
| 44 def db_exists(config): | 37 def db_exists(config): |
| 45 return os.path.exists(os.path.join(config.DATABASE, 'db')) | 38 return os.path.exists(os.path.join(config.DATABASE, 'db')) |
| 46 | 39 |
