[llvm] r188007 - [lit] Eliminate some nested imports.
Daniel Dunbar
daniel at zuster.org
Thu Aug 8 13:59:17 PDT 2013
Author: ddunbar
Date: Thu Aug 8 15:59:16 2013
New Revision: 188007
URL: http://llvm.org/viewvc/llvm-project?rev=188007&view=rev
Log:
[lit] Eliminate some nested imports.
Modified:
llvm/trunk/utils/lit/lit/LitConfig.py
llvm/trunk/utils/lit/lit/ProgressBar.py
llvm/trunk/utils/lit/lit/Util.py
llvm/trunk/utils/lit/lit/main.py
Modified: llvm/trunk/utils/lit/lit/LitConfig.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/LitConfig.py?rev=188007&r1=188006&r2=188007&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/LitConfig.py (original)
+++ llvm/trunk/utils/lit/lit/LitConfig.py Thu Aug 8 15:59:16 2013
@@ -1,5 +1,7 @@
from __future__ import absolute_import
+import inspect
import os
+import sys
import lit.Test
import lit.TestFormats
@@ -75,8 +77,6 @@ class LitConfig:
def getBashPath(self):
"""getBashPath - Get the path to 'bash'"""
- import os
-
if self.bashPath is not None:
return self.bashPath
@@ -110,8 +110,6 @@ class LitConfig:
return dir
def _write_message(self, kind, message):
- import inspect, os, sys
-
# Get the file/line where this message was generated.
f = inspect.currentframe()
# Step out of _write_message, and then out of wrapper.
@@ -134,6 +132,5 @@ class LitConfig:
self.numErrors += 1
def fatal(self, message):
- import sys
self._write_message('fatal', message)
sys.exit(2)
Modified: llvm/trunk/utils/lit/lit/ProgressBar.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/ProgressBar.py?rev=188007&r1=188006&r2=188007&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/ProgressBar.py (original)
+++ llvm/trunk/utils/lit/lit/ProgressBar.py Thu Aug 8 15:59:16 2013
@@ -273,7 +273,6 @@ class ProgressBar:
self.cleared = 1
def test():
- import time
tc = TerminalController()
p = ProgressBar(tc, 'Tests')
for i in range(101):
Modified: llvm/trunk/utils/lit/lit/Util.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/Util.py?rev=188007&r1=188006&r2=188007&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/Util.py (original)
+++ llvm/trunk/utils/lit/lit/Util.py Thu Aug 8 15:59:16 2013
@@ -1,4 +1,9 @@
-import os, sys
+import errno
+import itertools
+import math
+import os
+import subprocess
+import sys
def detectCPUs():
"""
@@ -23,8 +28,6 @@ def detectCPUs():
def mkdir_p(path):
"""mkdir_p(path) - Make the "path" directory, if it does not exist; this
will also make directories for any missing parent directories."""
- import errno
-
if not path or os.path.exists(path):
return
@@ -41,7 +44,6 @@ def mkdir_p(path):
raise
def capture(args, env=None):
- import subprocess
"""capture(command) - Run the given command (or argv list) in a shell and
return the standard output."""
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
@@ -93,8 +95,6 @@ def whichTools(tools, paths):
return None
def printHistogram(items, title = 'Items'):
- import itertools, math
-
items.sort(key = lambda item: item[1])
maxValue = max([v for _,v in items])
Modified: llvm/trunk/utils/lit/lit/main.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/main.py?rev=188007&r1=188006&r2=188007&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/main.py (original)
+++ llvm/trunk/utils/lit/lit/main.py Thu Aug 8 15:59:16 2013
@@ -161,7 +161,6 @@ def main(builtinParameters = {}):
# blocking operation (hopefully exec) than to try and unblock other threads.
#
# FIXME: This is a hack.
- import sys
sys.setcheckinterval(1000)
global options
More information about the llvm-commits
mailing list