diff --git a/lldb/examples/summaries/synth.py b/lldb/examples/summaries/synth.py index 23f02d9b50f3..02dcc4f70146 100644 --- a/lldb/examples/summaries/synth.py +++ b/lldb/examples/summaries/synth.py @@ -33,11 +33,8 @@ class PythonObjectSyntheticChildProvider(object): def gen_child(self, name, value): data = None type = None - if isinstance(value, int): - data = lldb.SBData.CreateDataFromUInt32Array( - self.bo, self.ps, [value]) - type = self.value.target.GetBasicType(lldb.eBasicTypeInt) - elif isinstance(value, long): + import six + if isinstance(value, six.integer_types): data = lldb.SBData.CreateDataFromUInt64Array( self.bo, self.ps, [value]) type = self.value.target.GetBasicType(lldb.eBasicTypeLong) diff --git a/lldb/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py b/lldb/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py index 287c1c1b87b3..f844fff978c4 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 e34fc3416d7e..a2d8be94acf7 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 59a5b324465f..45af45701d63 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")