]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Raise the sqlite3 import error, not the pysqlite2 one
authorrobin <y8765gd@gmail.com>
Sat, 27 Jan 2018 18:02:30 +0000 (13:02 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 27 Jan 2018 18:06:15 +0000 (13:06 -0500)
commit5fac520b2a1d168387319548c6674d89928f0067
tree786dd1fddb5bb1178374b39f768b9301fc3c9e0a
parent1d435b9f49136f53aac4aa457f7744227be0b26a
Raise the sqlite3 import error, not the pysqlite2 one

Fixed the import error raised when a platform
has neither pysqlite2 nor sqlite3 installed, such
that the sqlite3-related import error is raised,
not the pysqlite2 one which is not the actual
failure mode.  Pull request courtesy Robin.

Origin version only print `No module named pysqlite2` even
it's actually the import error of line 337: `from
sqlite3 import dbapi2 as sqlite` which point user
to the wrong debug direction.

It should raise `e.message` as `No module named _sqlite3`.

Change-Id: Idc39cd0d226957fd670859df23a2386dea6eb3cc
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/417
doc/build/changelog/unreleased_12/sqlite_import.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/sqlite/pysqlite.py