From 65ba875d5bf2b2752b8fe29a8b1603c291c834df Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 6 Apr 2016 13:17:44 -0700 Subject: [PATCH] allow using sqlite from pysqlite2 in case Python was built with an incomplete standard library (missing sqlite3) we do the same thing in IPython history, etc. --- notebook/services/sessions/sessionmanager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/notebook/services/sessions/sessionmanager.py b/notebook/services/sessions/sessionmanager.py index 8f5a6845c1..f0554bf740 100644 --- a/notebook/services/sessions/sessionmanager.py +++ b/notebook/services/sessions/sessionmanager.py @@ -4,7 +4,12 @@ # Distributed under the terms of the Modified BSD License. import uuid -import sqlite3 + +try: + import sqlite3 +except ImportError: + # fallback on pysqlite2 if Python was build without sqlite + from pysqlite2 import dbapi2 as sqlite3 from tornado import gen, web