summaryrefslogtreecommitdiff
path: root/test/SConsignFile
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-04-24 09:09:38 -0700
committerWilliam Deegan <bill@baddogconsulting.com>2017-04-24 09:09:38 -0700
commite9a8a911c8a925c39e4db45ee739c15b122f0ab2 (patch)
treed70c3b7d839c8a55f8af387ee6f756a7bab3caee /test/SConsignFile
parent0f65df5bc6365d64b4d2bd2d9ebc37e345bc7ae9 (diff)
downloadscons-e9a8a911c8a925c39e4db45ee739c15b122f0ab2.tar.gz
py2/3 use dbm.ndbm on py3 and plain dbm doesn't create .sconsign.db, but rather .sconsign and causes test to fail. Continue to use dbm on py2 as dbm.ndbm doesn't exist there
Diffstat (limited to 'test/SConsignFile')
-rw-r--r--test/SConsignFile/use-dbm.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/SConsignFile/use-dbm.py b/test/SConsignFile/use-dbm.py
index 90983b30..129d5b65 100644
--- a/test/SConsignFile/use-dbm.py
+++ b/test/SConsignFile/use-dbm.py
@@ -34,10 +34,16 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
+
try:
import dbm.ndbm
+ use_db = 'dbm.ndbm'
except ImportError:
- test.skip_test('No dbm in this version of Python; skipping test.\n')
+ try:
+ import dbm
+ use_db = 'dbm'
+ except ImportError:
+ test.skip_test('No dbm.ndbm in this version of Python; skipping test.\n')
test.subdir('subdir')
@@ -53,8 +59,8 @@ sys.exit(0)
#
test.write('SConstruct', """
import sys
-import dbm
-SConsignFile('.sconsign', dbm)
+import %(use_db)s
+SConsignFile('.sconsign', %(use_db)s)
B = Builder(action = '%(_python_)s build.py $TARGETS $SOURCES')
env = Environment(BUILDERS = { 'B' : B })
env.B(target = 'f1.out', source = 'f1.in')