[Lldb-commits] [lldb] r251862 - Revert "Remove the __import__ hack of lldbtest_config."

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 2 16:32:20 PST 2015


I think what is happening is that when we go through unittest2, the package
link is being broken.

Inside dotest.py : __package__ = lldbsuite.test
Inside unittest2.loadTestsFromName : __package__ = unittest2
Inside TestMultithreaded.py : __package__ = None

Restoring the link by writing

__package__ = "lldbsuite.test"

at the top of TestMultithreaded.py seems to fix the problem, although that
really bothersome to have to do that in every single file.  I'm still
trying to figure out the proper fix.

On Mon, Nov 2, 2015 at 3:41 PM Pavel Labath via lldb-commits <
lldb-commits at lists.llvm.org> wrote:

> Author: labath
> Date: Mon Nov  2 17:39:09 2015
> New Revision: 251862
>
> URL: http://llvm.org/viewvc/llvm-project?rev=251862&view=rev
> Log:
> Revert "Remove the __import__ hack of lldbtest_config."
>
> The hack still seems to be necessary. Putting it back in until we figure
> out why.
>
> Modified:
>     lldb/trunk/packages/Python/lldbsuite/test/dotest.py
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=251862&r1=251861&r2=251862&view=diff
>
> ==============================================================================
> --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
> +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Mon Nov  2
> 17:39:09 2015
> @@ -19,11 +19,14 @@ for available options.
>  """
>
>  from __future__ import print_function
> +# this module needs to have global visibility, otherwise test cases
> +# will import it anew in their local namespace, essentially losing access
> +# to all the configuration data
> +globals()['lldbtest_config'] = __import__('lldbtest_config')
>
>  import use_lldb_suite
> -import lldbsuite
>
> -import lldbtest_config
> +import lldbsuite
>
>  import atexit
>  import commands
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151103/5925d5ad/attachment.html>


More information about the lldb-commits mailing list