[lit] Make main.py a pure Python module
authorJulian Lettner <jlettner@apple.com>
Sat, 26 Oct 2019 01:51:29 +0000 (18:51 -0700)
committerJulian Lettner <jlettner@apple.com>
Mon, 28 Oct 2019 16:56:37 +0000 (09:56 -0700)
Running it directly as a tool, that is what lit.py is for.

llvm/utils/lit/lit.py
llvm/utils/lit/lit/main.py

index af070c6..2f1fb43 100755 (executable)
@@ -1,7 +1,6 @@
 #!/usr/bin/env python
-import sys
 
-from lit.main import main
+import lit.main
 
-if __name__=='__main__':
-    main()
+if __name__ == '__main__':
+    lit.main()
index e56cd44..7e8db08 100755 (executable)
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
 """
 lit - LLVM Integrated Tester.
 
@@ -381,6 +379,3 @@ def write_test_results_xunit(tests, opts):
         xunit_output_file.write("</testsuite>\n")
     xunit_output_file.write("</testsuites>")
     xunit_output_file.close()
-
-if __name__=='__main__':
-    main()