mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-09 04:36:49 +00:00
[lit] Eliminate some nested imports.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188007 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9d11edb416
commit
0e5f7c5d2f
@ -1,5 +1,7 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
import inspect
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
import lit.Test
|
import lit.Test
|
||||||
import lit.TestFormats
|
import lit.TestFormats
|
||||||
@ -75,8 +77,6 @@ class LitConfig:
|
|||||||
|
|
||||||
def getBashPath(self):
|
def getBashPath(self):
|
||||||
"""getBashPath - Get the path to 'bash'"""
|
"""getBashPath - Get the path to 'bash'"""
|
||||||
import os
|
|
||||||
|
|
||||||
if self.bashPath is not None:
|
if self.bashPath is not None:
|
||||||
return self.bashPath
|
return self.bashPath
|
||||||
|
|
||||||
@ -110,8 +110,6 @@ class LitConfig:
|
|||||||
return dir
|
return dir
|
||||||
|
|
||||||
def _write_message(self, kind, message):
|
def _write_message(self, kind, message):
|
||||||
import inspect, os, sys
|
|
||||||
|
|
||||||
# Get the file/line where this message was generated.
|
# Get the file/line where this message was generated.
|
||||||
f = inspect.currentframe()
|
f = inspect.currentframe()
|
||||||
# Step out of _write_message, and then out of wrapper.
|
# Step out of _write_message, and then out of wrapper.
|
||||||
@ -134,6 +132,5 @@ class LitConfig:
|
|||||||
self.numErrors += 1
|
self.numErrors += 1
|
||||||
|
|
||||||
def fatal(self, message):
|
def fatal(self, message):
|
||||||
import sys
|
|
||||||
self._write_message('fatal', message)
|
self._write_message('fatal', message)
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
@ -273,7 +273,6 @@ class ProgressBar:
|
|||||||
self.cleared = 1
|
self.cleared = 1
|
||||||
|
|
||||||
def test():
|
def test():
|
||||||
import time
|
|
||||||
tc = TerminalController()
|
tc = TerminalController()
|
||||||
p = ProgressBar(tc, 'Tests')
|
p = ProgressBar(tc, 'Tests')
|
||||||
for i in range(101):
|
for i in range(101):
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
import os, sys
|
import errno
|
||||||
|
import itertools
|
||||||
|
import math
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
def detectCPUs():
|
def detectCPUs():
|
||||||
"""
|
"""
|
||||||
@ -23,8 +28,6 @@ def detectCPUs():
|
|||||||
def mkdir_p(path):
|
def mkdir_p(path):
|
||||||
"""mkdir_p(path) - Make the "path" directory, if it does not exist; this
|
"""mkdir_p(path) - Make the "path" directory, if it does not exist; this
|
||||||
will also make directories for any missing parent directories."""
|
will also make directories for any missing parent directories."""
|
||||||
import errno
|
|
||||||
|
|
||||||
if not path or os.path.exists(path):
|
if not path or os.path.exists(path):
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -41,7 +44,6 @@ def mkdir_p(path):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
def capture(args, env=None):
|
def capture(args, env=None):
|
||||||
import subprocess
|
|
||||||
"""capture(command) - Run the given command (or argv list) in a shell and
|
"""capture(command) - Run the given command (or argv list) in a shell and
|
||||||
return the standard output."""
|
return the standard output."""
|
||||||
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||||
@ -93,8 +95,6 @@ def whichTools(tools, paths):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def printHistogram(items, title = 'Items'):
|
def printHistogram(items, title = 'Items'):
|
||||||
import itertools, math
|
|
||||||
|
|
||||||
items.sort(key = lambda item: item[1])
|
items.sort(key = lambda item: item[1])
|
||||||
|
|
||||||
maxValue = max([v for _,v in items])
|
maxValue = max([v for _,v in items])
|
||||||
|
@ -161,7 +161,6 @@ def main(builtinParameters = {}):
|
|||||||
# blocking operation (hopefully exec) than to try and unblock other threads.
|
# blocking operation (hopefully exec) than to try and unblock other threads.
|
||||||
#
|
#
|
||||||
# FIXME: This is a hack.
|
# FIXME: This is a hack.
|
||||||
import sys
|
|
||||||
sys.setcheckinterval(1000)
|
sys.setcheckinterval(1000)
|
||||||
|
|
||||||
global options
|
global options
|
||||||
|
Loading…
Reference in New Issue
Block a user