summaryrefslogtreecommitdiff
path: root/engine/SCons/Util.py
diff options
context:
space:
mode:
Diffstat (limited to 'engine/SCons/Util.py')
-rw-r--r--engine/SCons/Util.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/engine/SCons/Util.py b/engine/SCons/Util.py
index 2a1604b..c9aa2b5 100644
--- a/engine/SCons/Util.py
+++ b/engine/SCons/Util.py
@@ -24,7 +24,7 @@ Various utility functions go here.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Util.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"
+__revision__ = "src/engine/SCons/Util.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog"
import os
import sys
@@ -481,10 +481,7 @@ def to_String_for_subst(s,
if isinstance(s, BaseStringTypes):
return s
elif isinstance(s, SequenceTypes):
- l = []
- for e in s:
- l.append(to_String_for_subst(e))
- return ' '.join( s )
+ return ' '.join([to_String_for_subst(e) for e in s])
elif isinstance(s, UserString):
# s.data can only be either a unicode or a regular
# string. Please see the UserString initializer.
@@ -1622,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