summaryrefslogtreecommitdiff
path: root/QMTest
diff options
context:
space:
mode:
authorDirk Baechle <dl9obn@darc.de>2015-12-10 18:01:37 +0100
committerDirk Baechle <dl9obn@darc.de>2015-12-10 18:01:37 +0100
commit116e6ff0e0b446323532b33a6018249e97e92e3b (patch)
treed88708df964dc576ad2a85eedd9ef08cd29a0240 /QMTest
parent7da3d7d21c8ab47b73b3cd0733edecf314258d83 (diff)
downloadscons-116e6ff0e0b446323532b33a6018249e97e92e3b.tar.gz
removed several pre-2.7 methods and imports, including some basic refactorings
Diffstat (limited to 'QMTest')
-rw-r--r--QMTest/TestCmd.py14
-rw-r--r--QMTest/TestCommon.py25
2 files changed, 0 insertions, 39 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py
index 30489738..cd559b75 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 c4a5373b..dc4c97c2 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'