diff options
author | Luca Falavigna <dktrkranz@debian.org> | 2013-03-11 22:26:43 +0100 |
---|---|---|
committer | Luca Falavigna <dktrkranz@debian.org> | 2013-03-11 22:26:43 +0100 |
commit | cc58c8587a4e67f389b00e5d3278fae049ac7399 (patch) | |
tree | e7c4f72161659579c954d252a381488bc34637fb /engine/SCons/compat/_scons_builtins.py | |
parent | de88ed62712f996f44628e2e83af1026181175d8 (diff) |
Imported Upstream version 2.3.0upstream/2.3.0
Diffstat (limited to 'engine/SCons/compat/_scons_builtins.py')
-rw-r--r-- | engine/SCons/compat/_scons_builtins.py | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/engine/SCons/compat/_scons_builtins.py b/engine/SCons/compat/_scons_builtins.py index 32f4e75..1202d46 100644 --- a/engine/SCons/compat/_scons_builtins.py +++ b/engine/SCons/compat/_scons_builtins.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation +# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -37,7 +37,6 @@ This module checks for the following builtins names: all() any() - sorted() memoryview() Implementations of functions are *NOT* guaranteed to be fully compliant @@ -52,7 +51,7 @@ the FUNCTIONS or DATA output, that means those names are already built in to this version of Python and we don't need to add them from this module. """ -__revision__ = "src/engine/SCons/compat/_scons_builtins.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo" +__revision__ = "src/engine/SCons/compat/_scons_builtins.py 2013/03/03 09:48:35 garyo" import builtins @@ -101,48 +100,6 @@ except NameError: return self.obj[indx] builtins.memoryview = memoryview -try: - sorted -except NameError: - # Pre-2.4 Python has no sorted() function. - # - # The pre-2.4 Python list.sort() method does not support - # list.sort(key=) nor list.sort(reverse=) keyword arguments, so - # we must implement the functionality of those keyword arguments - # by hand instead of passing them to list.sort(). - def sorted(iterable, cmp=None, key=None, reverse=False): - if key is not None: - result = [(key(x), x) for x in iterable] - else: - result = iterable[:] - if cmp is None: - # Pre-2.3 Python does not support list.sort(None). - result.sort() - else: - result.sort(cmp) - if key is not None: - result = [t1 for t0,t1 in result] - if reverse: - result.reverse() - return result - builtins.sorted = sorted - -#if sys.version_info[:3] in ((2, 2, 0), (2, 2, 1)): -# def lstrip(s, c=string.whitespace): -# while s and s[0] in c: -# s = s[1:] -# return s -# def rstrip(s, c=string.whitespace): -# while s and s[-1] in c: -# s = s[:-1] -# return s -# def strip(s, c=string.whitespace, l=lstrip, r=rstrip): -# return l(r(s, c), c) -# -# object.__setattr__(str, 'lstrip', lstrip) -# object.__setattr__(str, 'rstrip', rstrip) -# object.__setattr__(str, 'strip', strip) - # Local Variables: # tab-width:4 # indent-tabs-mode:nil |