blob: 8913a1e70d80da16ed340a07eac889e713918b79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
--- axiom/_pysqlite2.py 2006-07-05 18:31:18.000000000 +0300
+++ axiom/_pysqlite2.py 2007-11-02 05:10:45.000000000 +0200
@@ -8,7 +8,11 @@
"""
import time
-from pysqlite2 import dbapi2
+# Use python2.5's sqlite3 if avaliable
+try:
+ from sqlite3 import dbapi2
+except:
+ from pysqlite2 import dbapi2
from twisted.python import log
--- axiom/test/test_pysqlite2.py 2006-07-02 19:23:40.000000000 +0300
+++ axiom/test/test_pysqlite2.py 2007-11-02 05:39:44.000000000 +0200
@@ -2,7 +2,11 @@
Test cases for PySQLite2-specific parts of the backend.
"""
-from pysqlite2.dbapi2 import OperationalError
+# Use python2.5's sqlite3 if avaliable
+try:
+ from sqlite3.dbapi2 import OperationalError
+except:
+ from pysqlite2.dbapi2 import OperationalError
from twisted.trial.unittest import TestCase
--- axiom/test/test_xatop.py 2007-02-23 02:09:19.000000000 +0200
+++ axiom/test/test_xatop.py 2007-11-02 05:38:48.000000000 +0200
@@ -9,7 +9,11 @@
from axiom import attributes, item, store, errors
from axiom.errors import ItemNotFound
-from pysqlite2.dbapi2 import sqlite_version_info
+# Use python2.5's sqlite3 if avaliable
+try:
+ from sqlite3.dbapi2 import sqlite_version_info
+except:
+ from pysqlite2.dbapi2 import sqlite_version_info
class RevertException(Exception):
|