Rev 407: Add check for pysqlite (fixes #80473). in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev

Jelmer Vernooij jelmer at samba.org
Sat Jan 20 16:03:42 GMT 2007


------------------------------------------------------------
revno: 407
revision-id: jelmer at samba.org-20070120160208-rnrt8vo3m396330p
parent: jelmer at samba.org-20070118193803-s4zr8hb59dupq9u4
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Sat 2007-01-20 17:02:08 +0100
message:
  Add check for pysqlite (fixes #80473).
modified:
  __init__.py                    __init__.py-20051008155114-eae558e6cf149e1d
=== modified file '__init__.py'
--- a/__init__.py	2007-01-18 16:46:43 +0000
+++ b/__init__.py	2007-01-20 16:02:08 +0000
@@ -65,8 +65,23 @@
         warning('Installed Subversion version does not have updated Python bindings. See the bzr-svn README for details.')
         raise bzrlib.errors.BzrError("incompatible python subversion bindings")
 
+def check_pysqlite_version():
+    """Check that sqlite library is compatible.
+
+    """
+    from bzrlib.trace import warning
+    try:
+        try:
+            import sqlite3
+        except ImportError:
+            from pysqlite2 import dbapi2 
+    except:
+        warning('Needs at least Python2.5 or Python2.4 with the pysqlite2 module')
+        raise bzrlib.errors.BzrError("missing sqlite library")
+
 check_bzrlib_version(required_bzr_version)
 check_subversion_version()
+check_pysqlite_version()
 
 import branch
 import convert




More information about the bazaar-commits mailing list