From fd9c768bf1b749a15d56481a49f7d60dd22a7ef6 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 15 May 2016 15:16:34 -0700 Subject: revert some py3 changes which fail no py2 on windows and any platform/python without dbm module installed. Revisit py3 issues after we get py2 working again --- src/script/sconsign.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/script/sconsign.py b/src/script/sconsign.py index 6f49858..e046a2c 100644 --- a/src/script/sconsign.py +++ b/src/script/sconsign.py @@ -187,7 +187,9 @@ sys.path = libs + sys.path import SCons.compat import whichdb -import dbm + +# was added for py3, but breaks py2 on windows.. +#import dbm import time import pickle import imp @@ -205,8 +207,14 @@ def my_whichdb(filename): pass return _orig_whichdb(filename) + +# Should work on python2 _orig_whichdb = whichdb.whichdb -dbm.whichdb = my_whichdb +whichdb.whichdb = my_whichdb + +# was changed for python3 +#_orig_whichdb = whichdb.whichdb +#dbm.whichdb = my_whichdb def my_import(mname): if '.' in mname: @@ -523,7 +531,9 @@ if Do_Call: Do_Call(a) else: for a in args: - dbm_name = dbm.whichdb(a) + # changed for py3 compat, broke py2 on windows + # dbm_name = dbm.whichdb(a) + dbm_name = whichdb.whichdb(a) if dbm_name: Map_Module = {'SCons.dblite' : 'dblite'} if dbm_name != "SCons.dblite": -- cgit v0.12