Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

try to fallback to pysqlite2.dbapi2 as sqlite3 in core.history #2718

Merged
merged 1 commit into from

4 participants

@skyl

for situations where Python is built without sqlite3 and
can not easily be changed, it would be nice to still be
able to get history with pysqlite2.

@skyl skyl try to fallback to pysqlite2.dbapi2 as sqlite3
for situations where Python is built without sqlite3 and
can not easily be changed, it would be nice to still be
able to get history with pysqlite2.
09c5f96
@Carreau Carreau commented on the diff
IPython/core/history.py
@@ -20,7 +20,10 @@
try:
import sqlite3
except ImportError:
- sqlite3 = None
+ try:
+ from pysqlite2 import dbapi2 as sqlite3
@Carreau Owner
Carreau added a note

Do we have guaranties that the api will be the same ?

I don't like importing as sqlite3 as later you don't know that sqlite3 is not effectively sqlite3

Maybe importing both as history_db and change sqlite3 references across all file ?

@takluyver Owner
@minrk Owner
minrk added a note

I disabled sqlite3 and ran iptest, and played around interactively, and this seems to work just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Carreau
Owner

Merging as this seem to be ok.

@Carreau Carreau merged commit 42886e3 into ipython:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 24, 2012
  1. @skyl

    try to fallback to pysqlite2.dbapi2 as sqlite3

    skyl authored
    for situations where Python is built without sqlite3 and
    can not easily be changed, it would be nice to still be
    able to get history with pysqlite2.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +4 −1 IPython/core/history.py
View
5 IPython/core/history.py
@@ -20,7 +20,10 @@
try:
import sqlite3
except ImportError:
- sqlite3 = None
+ try:
+ from pysqlite2 import dbapi2 as sqlite3
@Carreau Owner
Carreau added a note

Do we have guaranties that the api will be the same ?

I don't like importing as sqlite3 as later you don't know that sqlite3 is not effectively sqlite3

Maybe importing both as history_db and change sqlite3 references across all file ?

@takluyver Owner
@minrk Owner
minrk added a note

I disabled sqlite3 and ran iptest, and played around interactively, and this seems to work just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ except ImportError:
+ sqlite3 = None
import threading
# Our own packages
Something went wrong with that request. Please try again.