summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-10-03 06:19:50 +0000
committerFangrui Song <maskray@google.com>2019-10-03 06:19:50 +0000
commitc4b5e594b4de3cdfea4ff3daa60a11d4f0b6b7bf (patch)
tree4539e98cf390a3089163c7160c40fb37b5839c2d
parent3a6950d3f02956f7c7001ce7f9e6c47ca1423f3f (diff)
downloadbcm5719-llvm-c4b5e594b4de3cdfea4ff3daa60a11d4f0b6b7bf.tar.gz
bcm5719-llvm-c4b5e594b4de3cdfea4ff3daa60a11d4f0b6b7bf.zip
Fix libc++ pretty printer test for Python 3 after D67238 (take 2)
In both Python 2 and Python 3, gdb.Value.string returns a 'str'. We just need to delete a `encode("utf-8")` which would return a 'bytes' in Python 3. llvm-svn: 373570
-rw-r--r--libcxx/test/pretty_printers/gdb_pretty_printer_test.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/libcxx/test/pretty_printers/gdb_pretty_printer_test.py b/libcxx/test/pretty_printers/gdb_pretty_printer_test.py
index b738c72b64c..ece13b7b329 100644
--- a/libcxx/test/pretty_printers/gdb_pretty_printer_test.py
+++ b/libcxx/test/pretty_printers/gdb_pretty_printer_test.py
@@ -46,12 +46,10 @@ class CheckResult(gdb.Command):
gdb.newest_frame().select()
expectation_val = compare_frame.read_var("expectation")
+ check_literal = expectation_val.string(encoding="utf-8")
if "PrettyPrintToRegex" in compare_frame.name():
- check_literal = expectation_val.string()
test_fails = not re.match(check_literal, value)
else:
- check_literal_string = expectation_val.string(encoding="utf-8")
- check_literal = str(check_literal_string.encode("utf-8"))
test_fails = value != check_literal
if test_fails:
OpenPOWER on IntegriCloud