summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-03-11 04:28:39 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-03-11 04:28:39 (GMT)
commit1bb14fca2a72f0f97a0738a7819624edfa6756b3 (patch)
tree84f5445098fdd8662380508fa9c65f10176919ef /src/script
parent32c43164f036af6e9f83eaf1826274fcf5332fba (diff)
downloadSCons-1bb14fca2a72f0f97a0738a7819624edfa6756b3.zip
SCons-1bb14fca2a72f0f97a0738a7819624edfa6756b3.tar.gz
SCons-1bb14fca2a72f0f97a0738a7819624edfa6756b3.tar.bz2
use whichdb from dbm for py3, and whichdb from whichdb for py2
Diffstat (limited to 'src/script')
-rw-r--r--src/script/sconsign.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/script/sconsign.py b/src/script/sconsign.py
index 13fac98..239979f 100644
--- a/src/script/sconsign.py
+++ b/src/script/sconsign.py
@@ -186,10 +186,12 @@ sys.path = libs + sys.path
import SCons.compat
-import whichdb
+try:
+ import whichdb
+ whichdb = whichdb.whichdb
+except ImportError as e:
+ from dbm import whichdb
-# was added for py3, but breaks py2 on windows..
-#import dbm
import time
import pickle
import imp
@@ -209,8 +211,8 @@ def my_whichdb(filename):
# Should work on python2
-_orig_whichdb = whichdb.whichdb
-whichdb.whichdb = my_whichdb
+_orig_whichdb = whichdb
+whichdb = my_whichdb
# was changed for python3
#_orig_whichdb = whichdb.whichdb
@@ -531,9 +533,7 @@ if Do_Call:
Do_Call(a)
else:
for a in args:
- # changed for py3 compat, broke py2 on windows
- # dbm_name = dbm.whichdb(a)
- dbm_name = whichdb.whichdb(a)
+ dbm_name = whichdb(a)
if dbm_name:
Map_Module = {'SCons.dblite' : 'dblite'}
if dbm_name != "SCons.dblite":