Skip to content

Commit

Permalink
Fix: ImportError: No module named _sqlite3 (#71)
Browse files Browse the repository at this point in the history
* Fix: ImportError: No module named _sqlite3

I have machines with Freebsd 11.1 and Python 2.7.14. Unfortunately, I can't install the dev bindings (not packaged).
Fix: Add ImportError exception

* Add log message wen sqlite3 module can't be loaded
  • Loading branch information
teunis90 authored and peter-wangxu committed Oct 17, 2018
1 parent 487bf1d commit f63afa7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions persistqueue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
__version__ = '0.4.1'

from .exceptions import Empty, Full # noqa
from .pdict import PDict # noqa
from .queue import Queue # noqa
from .sqlqueue import SQLiteQueue, FIFOSQLiteQueue, FILOSQLiteQueue, UniqueQ # noqa
from .sqlackqueue import SQLiteAckQueue
try:
from .pdict import PDict # noqa
from .sqlqueue import SQLiteQueue, FIFOSQLiteQueue, FILOSQLiteQueue, UniqueQ # noqa
from .sqlackqueue import SQLiteAckQueue
except ImportError as error:
import logging
log = logging.getLogger(__name__)
log.info("No sqlite3 module found, sqlite3 based queues are not available")

__all__ = ["Queue", "SQLiteQueue", "FIFOSQLiteQueue", "FILOSQLiteQueue",
"UniqueQ", "PDict", "SQLiteAckQueue", "Empty", "Full",
Expand Down

0 comments on commit f63afa7

Please sign in to comment.