The 7.0 branch is not compatible with Python 3, at least not if you're not on Windows. The first release that is, would be 9.0, which is currently being qualified. This includes a bunch of compatibility fixes, and a newer version of the vendored pexpect (4.6). As you've noticed, using different versions of Python will not work either.
Your only option is to use Python 2.7, both for building LLDB and for running the test suite. Making sure the 2.7 interpreter is first in your PATH should be sufficient. Alternatively, you can explicitly pass -DPYTHON_EXECUTABLE=/path/to/python27. Cheers, Jonas On Tue, Jul 23, 2019 at 7:38 AM Romaric Jodin via lldb-dev < lldb-dev@lists.llvm.org> wrote: > Hi everyone, > > I'm trying to run the test suite on lldb and I'm having some issues with > Python. I'm on branch 7.0. > > When I build lldb, I've got a folder "python3.5/site-packages" generated. > So I believe that the build system found python3 in my environment. > But when I run the testsuite (using "ninja check-lldb"), I've got this > issue: > > Traceback (most recent call last): > File > "/home/rjodin/work/dpu_tools/llvm/lldb/lldb/packages/Python/lldbsuite/test/decorators.py", > line 113, in wrapper > func(*args, **kwargs) > File > "/home/rjodin/work/dpu_tools/llvm/lldb/lldb/packages/Python/lldbsuite/test/decorators.py", > line 341, in wrapper > return func(self, *args, **kwargs) > File > "/home/rjodin/work/dpu_tools/llvm/lldb/lldb/packages/Python/lldbsuite/test/functionalities/command_regex/TestCommandRegex.py", > line 39, in test_command_regex > child.expect_exact(prompt) > File > "/home/rjodin/work/dpu_tools/llvm/lldb/lldb/third_party/Python/module/pexpect-2.4/pexpect.py", > line 1386, in expect_exact > if type(pattern_list) in types.StringTypes or pattern_list in ( > AttributeError: module 'types' has no attribute 'StringTypes' > > It seems that it's because the code in "pexpect.py" is not compatible with > python3.5. > If I force the system to use python2.7, I've got another issue because of > the way "_lldb.so" is built (with python3.5): > > Traceback (most recent call last): > File "/home/rjodin/work/dpu_tools/llvm/lldb/lldb/test/dotest.py", line > 7, in <module> > lldbsuite.test.run_suite() > File > "/home/rjodin/work/dpu_tools/llvm/lldb/lldb/packages/Python/lldbsuite/test/dotest.py", > line 1180, in run_suite > import lldb > File > "/home/rjodin/package-sdk-2019.3.0/upmem-internal/usr/share/upmem/lib/python3.5/site-packages/lldb/__init__.py", > line 39, in <module> > import _lldb > ImportError: dynamic module does not define init function (init_lldb) > > > What do I do wrong? > Thanks, > -- > *Romaric JODIN* > UPMEM > *Software Engineer* > > _______________________________________________ > lldb-dev mailing list > lldb-dev@lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev >
_______________________________________________ lldb-dev mailing list lldb-dev@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev