diff options
author | Dirk Baechle <dl9obn@darc.de> | 2015-12-10 17:01:37 (GMT) |
---|---|---|
committer | Dirk Baechle <dl9obn@darc.de> | 2015-12-10 17:01:37 (GMT) |
commit | e7de9d22c9503cf29e5d8b5e7813f060d59a00e5 (patch) | |
tree | d88708df964dc576ad2a85eedd9ef08cd29a0240 /QMTest | |
parent | 78fb1b6ef0e42954feb668efb84de59173221374 (diff) | |
download | SCons-e7de9d22c9503cf29e5d8b5e7813f060d59a00e5.zip SCons-e7de9d22c9503cf29e5d8b5e7813f060d59a00e5.tar.gz SCons-e7de9d22c9503cf29e5d8b5e7813f060d59a00e5.tar.bz2 |
removed several pre-2.7 methods and imports, including some basic refactorings
Diffstat (limited to 'QMTest')
-rw-r--r-- | QMTest/TestCmd.py | 14 | ||||
-rw-r--r-- | QMTest/TestCommon.py | 25 |
2 files changed, 0 insertions, 39 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py index 3048973..cd559b7 100644 --- a/QMTest/TestCmd.py +++ b/QMTest/TestCmd.py @@ -317,20 +317,6 @@ except ImportError: exec('from UserList import UserList') exec('from UserString import UserString') -try: - # pre-2.7 doesn't have the memoryview() built-in - memoryview -except NameError: - class memoryview: - def __init__(self, obj): - # wrapping buffer in () keeps the fixer from changing it - self.obj = (buffer)(obj) - def __getitem__(self, indx): - if isinstance(indx, slice): - return self.obj[indx.start:indx.stop] - else: - return self.obj[indx] - __all__ = [ 'diff_re', 'fail_test', diff --git a/QMTest/TestCommon.py b/QMTest/TestCommon.py index c4a5373..dc4c97c 100644 --- a/QMTest/TestCommon.py +++ b/QMTest/TestCommon.py @@ -123,31 +123,6 @@ __all__.extend([ 'TestCommon', 'dll_suffix', ]) -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 - # Variables that describe the prefixes and suffixes on this system. if sys.platform == 'win32': exe_suffix = '.exe' |