From e73a0601bd1f208d4b4e30ffa6f53775e8c92f6c Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 6 Nov 2015 21:37:33 +0000 Subject: 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 --- lldb/packages/Python/lldbsuite/test/dotest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/dotest.py') 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 -- cgit v1.2.3