File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,13 @@ def bb(u): return u.encode('utf-8')
55
66try :
77 from bsddb import db
8+ has_bsddb = True
89except ImportError :
9- from bsddb3 import db
10-
10+ try :
11+ from bsddb3 import db
12+ has_bsddb = True
13+ except ImportError :
14+ has_bsddb = False
1115from os import mkdir
1216from os .path import exists , abspath
1317from urllib import pathname2url
@@ -22,6 +26,7 @@ class Sleepycat(Store):
2226 transaction_aware = False
2327
2428 def __init__ (self , configuration = None , identifier = None ):
29+ if not has_bsddb : raise Exception ("No local BerkeleyDB found." )
2530 self .__open = False
2631 self .__identifier = identifier
2732 super (Sleepycat , self ).__init__ (configuration )
@@ -54,6 +59,7 @@ def is_open(self):
5459 return self .__open
5560
5661 def open (self , path , create = True ):
62+ if not has_bsddb : return NO_STORE
5763 homeDir = path
5864
5965 if self .__identifier is None :
Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ commands =
2626 python setup.py clean --all
2727 python setup.py build
2828 python setup.py nosetests -q --where =./build/src
29- deps =
30- bsddb3
3129
3230[testenv:jython]
3331commands =
You can’t perform that action at this time.
0 commit comments