Patchwork [bitbake-devel] Martin Jansa : prserv: fix import of sqlite3

mail settings
Date Jan. 20, 2012, 4:57 p.m.
Message ID <20120120165748.A6D951033A@opal>
Download mbox | patch
Permalink /patch/19845/
State Not Applicable
Headers show

Comments - Jan. 20, 2012, 4:57 p.m.
Module: bitbake.git
Branch: master
Commit: 9a57ec705cf5c932d8c2a35852db7a4627c57937

Author: Martin Jansa <>
Date:   Sun Jan 15 22:03:53 2012 +0100

prserv: fix import of sqlite3

* this is used in all other bitbake parts where sqlite3 is used, don't
  know why it wasn't used here, but it fails e.g. on Gentoo
  Traceback (most recent call last):
    File "bin/bitbake", line 39, in <module>
      from bb import cooker
    File "lib/bb/", line 39, in <module>
      import prserv.serv
    File "lib/prserv/", line 4, in <module>
      import xmlrpclib,sqlite3
  ImportError: No module named sqlite3

Signed-off-by: Martin Jansa <>
Signed-off-by: Richard Purdie <>


 lib/prserv/ |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)


diff --git a/lib/prserv/ b/lib/prserv/
index a759fa7..fa437f9 100644
--- a/lib/prserv/
+++ b/lib/prserv/
@@ -1,7 +1,12 @@ 
 import os,sys,logging
 import signal, time, atexit, threading
 from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
-import xmlrpclib,sqlite3
+import xmlrpclib
+    import sqlite3
+except ImportError:
+    from pysqlite2 import dbapi2 as sqlite3
 import bb.server.xmlrpc
 import prserv