[PATCH] D25407: [lit] Remove (or allow specific) unused imports

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 13:57:42 PDT 2016


After this change llvm-lit must import main from lit.main. Something like
this should make it work again:

diff --git a/utils/llvm-lit/llvm-lit.in b/utils/llvm-lit/llvm-lit.in
index fc96202..57924fa 100755
--- a/utils/llvm-lit/llvm-lit.in
+++ b/utils/llvm-lit/llvm-lit.in
@@ -40,5 +40,5 @@ if os.path.exists(compilerrt_obj_root):
             os.path.join(compilerrt_obj_root, 'test')

 if __name__=='__main__':
-    import lit
-    lit.main(builtin_parameters)
+    from lit.main import main
+    main(builtin_parameters)


On Mon, Oct 10, 2016 at 6:17 AM, Alex Bradbury via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> asb added a comment.
>
> In https://reviews.llvm.org/D25407#566074, @grimar wrote:
>
> > Hi Brian, I have a error after that change on windows (when reverting
> r283710, it is works fine again):
> >
> > C:\c_make_build_dir\Debug\bin\llvm-lit.py -v
> C:\llvm\test\Object\invalid.test
> >  Traceback (most recent call last):
> >
> >     File "C:\c_make_build_dir\Debug\bin\llvm-lit.py", line 44, in
> <module>
> >       lit.main(builtin_parameters)
> >   AttributeError: 'module' object has no attribute 'main'
> >
>
>
> Same issue on Arch:
>
>   ./bin/llvm-lit test
>   Traceback (most recent call last):
>     File "./bin/llvm-lit", line 44, in <module>
>       lit.main(builtin_parameters)
>   AttributeError: module 'lit' has no attribute 'main'
>
>
> https://reviews.llvm.org/D25407
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>



-- 
--Artem Belevich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161010/82676758/attachment.html>


More information about the llvm-commits mailing list