Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SCons/cxxtest.py compatible with Python 3 #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions build_tools/SCons/cxxtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def multiget(dictlist, key, default = None):
dictionaries, the default is returned.
"""
for dict in dictlist:
if dict.has_key(key):
if key in dict:
return dict[key]
else:
return default
Expand Down Expand Up @@ -280,9 +280,6 @@ def generate(env, **kwargs):
python, docs and other subdirectories.
... and all others that Program() accepts, like CPPPATH etc.
"""

print "Loading CxxTest tool..."

#
# Expected behaviour: keyword arguments override environment variables;
# environment variables override default settings.
Expand All @@ -307,11 +304,11 @@ def generate(env, **kwargs):
env.SetDefault( CXXTEST_CXXTESTGEN_SCRIPT_NAME = 'cxxtestgen' )

#Here's where keyword arguments are applied
apply(env.Replace, (), kwargs)
env.Replace(**kwargs)

#If the user specified the path to CXXTEST, make sure it is correct
#otherwise, search for and set the default toolpath.
if (not kwargs.has_key('CXXTEST') or not isValidScriptPath(kwargs['CXXTEST']) ):
if 'CXXTEST' not in kwargs or not isValidScriptPath(kwargs['CXXTEST']):
env["CXXTEST"] = findCxxTestGen(env)

# find and add the CxxTest headers to the path.
Expand Down Expand Up @@ -397,4 +394,3 @@ def CxxTest(env, target, source = None, **kwargs):

def exists(env):
return os.path.exists(env['CXXTEST'])