summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-11-06 21:37:33 +0000
committerZachary Turner <zturner@google.com>2015-11-06 21:37:33 +0000
commite73a0601bd1f208d4b4e30ffa6f53775e8c92f6c (patch)
tree5bcfbd2cf133b8c444ce573037dc218c95fb4288 /lldb/packages/Python/lldbsuite/test
parent5821f7971429f94faaf35757b4e029326f1c53da (diff)
downloadbcm5719-llvm-e73a0601bd1f208d4b4e30ffa6f53775e8c92f6c.tar.gz
bcm5719-llvm-e73a0601bd1f208d4b4e30ffa6f53775e8c92f6c.zip
Python 3 - Port use of string.maketrans and don't use sets.Set.
`sets.Set` has been deprecated in favor of `set` since 2.6, and `string.maketrans` has to be special cased. In Python 3 there is `str.maketrans`, `bytes.maketrans`, and `bytearray.maketrans` and you have to choose the correct one. So we need to introduce a runtime version check at this site. llvm-svn: 252348
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest.py6
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py3
2 files changed, 5 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index 05152a3278e..2fcc6796cfc 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -1726,8 +1726,10 @@ def run_suite():
if iterArchs or iterCompilers:
# Translate ' ' to '-' for pathname component.
- from string import maketrans
- tbl = maketrans(' ', '-')
+ if six.PY2:
+ tbl = string.maketrans(' ', '-')
+ else:
+ tbl = str.maketrans(' ', '-')
configPostfix = configString.translate(tbl)
# Check whether we need to split stderr/stdout into configuration
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
index 603e8ae77af..7242f3ec98a 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -13,7 +13,6 @@ import platform
import random
import re
import select
-import sets
import signal
import socket
import subprocess
@@ -785,7 +784,7 @@ class GdbRemoteTestCaseBase(TestBase):
def select_modifiable_register(self, reg_infos):
"""Find a register that can be read/written freely."""
- PREFERRED_REGISTER_NAMES = sets.Set(["rax",])
+ PREFERRED_REGISTER_NAMES = set(["rax",])
# First check for the first register from the preferred register name set.
alternative_register_index = None
OpenPOWER on IntegriCloud