summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lldbtest.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index ae355a80c52..104cb619885 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -228,6 +228,10 @@ def line_number(filename, string_to_match):
"Unable to find '%s' within file %s" %
(string_to_match, filename))
+def get_line(filename, line_number):
+ """Return the text of the line at the 1-based line number."""
+ with io.open(filename, mode='r', encoding="utf-8") as f:
+ return f.readlines()[line_number - 1]
def pointer_size():
"""Return the pointer size of the host system."""
OpenPOWER on IntegriCloud