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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373570 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Fangrui Song 2019-10-03 06:19:50 +00:00
parent 48a15a7b3a
commit 11a6f223fb

View File

@ -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: