summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-10-26 16:49:57 +0000
committerZachary Turner <zturner@google.com>2015-10-26 16:49:57 +0000
commit744cd5d8ed9c46dc05718c9cf598a1a4f29ef8ff (patch)
tree36d50ffc82ba2e43c7c581868a45c37c0a5d610c
parentc4645bb0e653b85e2b41ce00c0f62a398d154f77 (diff)
downloadbcm5719-llvm-744cd5d8ed9c46dc05718c9cf598a1a4f29ef8ff.tar.gz
bcm5719-llvm-744cd5d8ed9c46dc05718c9cf598a1a4f29ef8ff.zip
Fix usages of range() and xrange() for Python 3.
llvm-svn: 251302
-rw-r--r--lldb/test/example/TestSequenceFunctions.py4
-rw-r--r--lldb/test/functionalities/inferior-assert/TestInferiorAssert.py4
-rw-r--r--lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py2
-rw-r--r--lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py2
-rw-r--r--lldb/test/lang/go/goroutines/TestGoroutines.py2
-rw-r--r--lldb/test/lang/go/types/TestGoASTContext.py2
-rw-r--r--lldb/test/lldbutil.py14
-rw-r--r--lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py2
8 files changed, 16 insertions, 16 deletions
diff --git a/lldb/test/example/TestSequenceFunctions.py b/lldb/test/example/TestSequenceFunctions.py
index f4f3d019e42..a0852930064 100644
--- a/lldb/test/example/TestSequenceFunctions.py
+++ b/lldb/test/example/TestSequenceFunctions.py
@@ -8,7 +8,7 @@ class SequenceFunctionsTestCase(unittest.TestCase):
def setUp(self):
#traceback.print_stack()
- self.seq = range(10)
+ self.seq = list(range(10))
def tearDown(self):
#traceback.print_stack()
@@ -18,7 +18,7 @@ class SequenceFunctionsTestCase(unittest.TestCase):
# make sure the shuffled sequence does not lose any elements
random.shuffle(self.seq)
self.seq.sort()
- self.assertEqual(self.seq, range(10))
+ self.assertEqual(self.seq, list(range(10)))
def test_choice(self):
element = random.choice(self.seq)
diff --git a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py
index 2bf1108cdbb..ccf4d61f222 100644
--- a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py
+++ b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py
@@ -20,7 +20,7 @@ class AssertingInferiorTestCase(TestBase):
self.inferior_asserting()
@expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows")
- @expectedFailureAndroid(api_levels=range(16 + 1)) # b.android.com/179836
+ @expectedFailureAndroid(api_levels=list(range(16 + 1))) # b.android.com/179836
def test_inferior_asserting_register(self):
"""Test that lldb reliably reads registers from the inferior after asserting (command)."""
self.build()
@@ -58,7 +58,7 @@ class AssertingInferiorTestCase(TestBase):
lldbutil.run_break_set_by_file_and_line (self, "main.c", line, num_expected_locations=1, loc_exact=True)
def check_stop_reason(self):
- if matchAndroid(api_levels=range(1, 16+1))(self):
+ if matchAndroid(api_levels=list(range(1, 16+1)))(self):
# On android until API-16 the abort() call ended in a sigsegv instead of in a sigabrt
stop_reason = 'stop reason = signal SIGSEGV'
else:
diff --git a/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py b/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py
index 3e79c777122..ad908f9dc4f 100644
--- a/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py
+++ b/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py
@@ -47,7 +47,7 @@ class CrashingInferiorTestCase(TestBase):
@expectedFailureFreeBSD('llvm.org/pr24939')
@expectedFailureWindows("llvm.org/pr24778")
- @expectedFailureAndroid(archs=['aarch64'], api_levels=range(21 + 1)) # No eh_frame for sa_restorer
+ @expectedFailureAndroid(archs=['aarch64'], api_levels=list(range(21 + 1))) # No eh_frame for sa_restorer
def test_inferior_crashing_step_after_break(self):
"""Test that lldb functions correctly after stepping through a crash."""
self.build()
diff --git a/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py b/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
index efc857d8a24..05af075a986 100644
--- a/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
+++ b/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
@@ -47,7 +47,7 @@ class CrashingRecursiveInferiorTestCase(TestBase):
@expectedFailureFreeBSD('llvm.org/pr24939')
@expectedFailureWindows("llvm.org/pr24778")
- @expectedFailureAndroid(archs=['aarch64'], api_levels=range(21 + 1)) # No eh_frame for sa_restorer
+ @expectedFailureAndroid(archs=['aarch64'], api_levels=list(range(21 + 1))) # No eh_frame for sa_restorer
def test_recursive_inferior_crashing_step_after_break(self):
"""Test that lldb functions correctly after stepping through a crash."""
self.build()
diff --git a/lldb/test/lang/go/goroutines/TestGoroutines.py b/lldb/test/lang/go/goroutines/TestGoroutines.py
index a51ad7b82f8..b3cfb764a36 100644
--- a/lldb/test/lang/go/goroutines/TestGoroutines.py
+++ b/lldb/test/lang/go/goroutines/TestGoroutines.py
@@ -75,7 +75,7 @@ class TestGoASTContext(TestBase):
# self.dbg.HandleCommand("log enable lldb os")
# Now test that stepping works if the memory thread moves to a different backing thread.
- for i in xrange(11):
+ for i in list(range(11)):
self.thread().StepOver()
self.assertEqual(lldb.eStopReasonPlanComplete, self.thread().GetStopReason(), self.thread().GetStopDescription(100))
diff --git a/lldb/test/lang/go/types/TestGoASTContext.py b/lldb/test/lang/go/types/TestGoASTContext.py
index 4c1e451bbca..ac4534a1526 100644
--- a/lldb/test/lang/go/types/TestGoASTContext.py
+++ b/lldb/test/lang/go/types/TestGoASTContext.py
@@ -129,5 +129,5 @@ class TestGoASTContext(TestBase):
v = self.var('theArray')
self.assertEqual(5, v.GetNumChildren())
- for i in xrange(5):
+ for i in list(range(5)):
self.assertEqual(str(i + 1), v.GetChildAtIndex(i).value)
diff --git a/lldb/test/lldbutil.py b/lldb/test/lldbutil.py
index c824990b5e7..f51d6e22a71 100644
--- a/lldb/test/lldbutil.py
+++ b/lldb/test/lldbutil.py
@@ -607,7 +607,7 @@ def get_function_names(thread):
def GetFuncName(i):
return thread.GetFrameAtIndex(i).GetFunctionName()
- return list(map(GetFuncName, range(thread.GetNumFrames())))
+ return list(map(GetFuncName, list(range(thread.GetNumFrames()))))
def get_symbol_names(thread):
@@ -617,7 +617,7 @@ def get_symbol_names(thread):
def GetSymbol(i):
return thread.GetFrameAtIndex(i).GetSymbol().GetName()
- return list(map(GetSymbol, range(thread.GetNumFrames())))
+ return list(map(GetSymbol, list(range(thread.GetNumFrames()))))
def get_pc_addresses(thread):
@@ -627,7 +627,7 @@ def get_pc_addresses(thread):
def GetPCAddress(i):
return thread.GetFrameAtIndex(i).GetPCAddress()
- return list(map(GetPCAddress, range(thread.GetNumFrames())))
+ return list(map(GetPCAddress, list(range(thread.GetNumFrames()))))
def get_filenames(thread):
@@ -637,7 +637,7 @@ def get_filenames(thread):
def GetFilename(i):
return thread.GetFrameAtIndex(i).GetLineEntry().GetFileSpec().GetFilename()
- return list(map(GetFilename, range(thread.GetNumFrames())))
+ return list(map(GetFilename, list(range(thread.GetNumFrames()))))
def get_line_numbers(thread):
@@ -647,7 +647,7 @@ def get_line_numbers(thread):
def GetLineNumber(i):
return thread.GetFrameAtIndex(i).GetLineEntry().GetLine()
- return list(map(GetLineNumber, range(thread.GetNumFrames())))
+ return list(map(GetLineNumber, list(range(thread.GetNumFrames()))))
def get_module_names(thread):
@@ -657,7 +657,7 @@ def get_module_names(thread):
def GetModuleName(i):
return thread.GetFrameAtIndex(i).GetModule().GetFileSpec().GetFilename()
- return list(map(GetModuleName, range(thread.GetNumFrames())))
+ return list(map(GetModuleName, list(range(thread.GetNumFrames()))))
def get_stack_frames(thread):
@@ -667,7 +667,7 @@ def get_stack_frames(thread):
def GetStackFrame(i):
return thread.GetFrameAtIndex(i)
- return list(map(GetStackFrame, range(thread.GetNumFrames())))
+ return list(map(GetStackFrame, list(range(thread.GetNumFrames()))))
def print_stacktrace(thread, string_buffer = False):
diff --git a/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py b/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py
index b8a970a5c64..0e1bf1b7615 100644
--- a/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py
+++ b/lldb/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py
@@ -34,7 +34,7 @@ class TestGdbRemoteAbort(gdbremote_testcase.GdbRemoteTestCaseBase):
@llgs_test
# std::abort() on <= API 16 raises SIGSEGV - b.android.com/179836
- @expectedFailureAndroid(api_levels=range(16 + 1))
+ @expectedFailureAndroid(api_levels=list(range(16 + 1)))
def test_inferior_abort_received_llgs(self):
self.init_llgs_test()
self.build()
OpenPOWER on IntegriCloud