diff options
author | Davide Italiano <davide@freebsd.org> | 2019-03-13 00:48:29 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2019-03-13 00:48:29 +0000 |
commit | ca715b6ea029a98425bf24d1c390034dc1e58e32 (patch) | |
tree | 77290ec2da540672490f1a0a9b2b1df3ec40ad4b /lldb/packages/Python/lldbsuite/test | |
parent | 750efba67c528edd1d1af700fd925927faa7adec (diff) | |
download | bcm5719-llvm-ca715b6ea029a98425bf24d1c390034dc1e58e32.tar.gz bcm5719-llvm-ca715b6ea029a98425bf24d1c390034dc1e58e32.zip |
[Python] Fix another batch of python 2/python 3 portability issues.
llvm-svn: 355998
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
3 files changed, 19 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py b/lldb/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py index 287c1c1b87b..f844fff978c 100644 --- a/lldb/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py +++ b/lldb/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py @@ -60,8 +60,13 @@ class DarwinNSLogOutputTestCase(TestBase): # So that the child gets torn down after the test. import pexpect - self.child = pexpect.spawn('%s %s %s' % (lldbtest_config.lldbExec, - self.lldbOption, exe)) + import sys + if sys.version_info.major == 3: + self.child = pexpect.spawnu('%s %s %s' % (lldbtest_config.lldbExec, + self.lldbOption, exe)) + else: + self.child = pexpect.spawn('%s %s %s' % (lldbtest_config.lldbExec, + self.lldbOption, exe)) child = self.child # Turn on logging for what the child sends back. diff --git a/lldb/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py b/lldb/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py index e34fc3416d7..a2d8be94acf 100644 --- a/lldb/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py +++ b/lldb/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py @@ -42,7 +42,11 @@ class TestSTTYBeforeAndAfter(TestBase): lldb_prompt = "(lldb) " # So that the child gets torn down after the test. - self.child = pexpect.spawn('expect') + import sys + if sys.version_info.major == 3: + self.child = pexpect.spawnu('expect') + else: + self.child = pexpect.spawn('expect') child = self.child child.expect(expect_prompt) diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py index 59a5b324465..45af45701d6 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py @@ -42,8 +42,13 @@ class MiTestCaseBase(Base): def spawnLldbMi(self, exe=None, args=None, preconfig=True): import pexpect - self.child = pexpect.spawn("%s --interpreter %s" % ( - self.lldbMiExec, args if args else ""), cwd=self.getBuildDir()) + import sys + if sys.version_info.major == 3: + self.child = pexpect.spawnu("%s --interpreter %s" % ( + self.lldbMiExec, args if args else ""), cwd=self.getBuildDir()) + else: + self.child = pexpect.spawn("%s --interpreter %s" % ( + self.lldbMiExec, args if args else ""), cwd=self.getBuildDir()) self.child.setecho(True) self.mylog = self.getBuildArtifact("child.log") self.child.logfile_read = open(self.mylog, "w") |