diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-10-11 18:34:14 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-10-11 18:34:14 (GMT) |
commit | 7144cf56430cff650a34ef102ad64ce5feb1d9cd (patch) | |
tree | 2a32a81a80542b45b87e1235199111bf22e85e92 /src/engine | |
parent | 81c02354dfd7634708eb79547e9448150cc016a6 (diff) | |
download | SCons-7144cf56430cff650a34ef102ad64ce5feb1d9cd.zip SCons-7144cf56430cff650a34ef102ad64ce5feb1d9cd.tar.gz SCons-7144cf56430cff650a34ef102ad64ce5feb1d9cd.tar.bz2 |
Add cmp to SCons.Util as py3 no longer provides it
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Util.py | 11 | ||||
-rw-r--r-- | src/engine/SCons/Variables/VariablesTests.py | 7 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index 11bcf2e..7ed9706 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -1619,6 +1619,17 @@ def to_str (s): return s return str (s, 'utf-8') + + +# No cmp in py3, so we'll define it. +def cmp(a, b): + """ + Define cmp because it's no longer available in python3 + Works under python 2 as well + """ + return (a > b) - (a < b) + + # Local Variables: # tab-width:4 # indent-tabs-mode:nil diff --git a/src/engine/SCons/Variables/VariablesTests.py b/src/engine/SCons/Variables/VariablesTests.py index 7ee66ca..b260d54 100644 --- a/src/engine/SCons/Variables/VariablesTests.py +++ b/src/engine/SCons/Variables/VariablesTests.py @@ -32,6 +32,7 @@ import TestUnit import SCons.Variables import SCons.Subst import SCons.Warnings +from SCons.Util import cmp class Environment(object): @@ -49,12 +50,6 @@ class Environment(object): return key in self.dict -def cmp(a, b): - """ - Define cmp because it's no longer available in python3 - Works under python 2 as well - """ - return (a > b) - (a < b) def check(key, value, env): |