Revert 7581, you can't have try except finally toghetter until python 2.5
We have some 2.4 versions on the windows buildbots, I will try to have these updated and reapply. Review URL: http://codereview.chromium.org/6821069 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7583 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
72fff00e48
commit
6baa8a2bde
@ -107,7 +107,7 @@ class MjsunitTestCase(test.TestCase):
|
||||
return self_script
|
||||
|
||||
def AfterRun(self, result):
|
||||
if self.self_script and (result is None or (not result.HasPreciousOutput())):
|
||||
if self.self_script and (not result.HasPreciousOutput()):
|
||||
test.CheckedUnlink(self.self_script)
|
||||
|
||||
class MjsunitTestConfiguration(test.TestConfiguration):
|
||||
|
@ -57,7 +57,7 @@ class SputnikTestCase(test.TestCase):
|
||||
|
||||
def AfterRun(self, result):
|
||||
# Dispose the temporary file if everything looks okay.
|
||||
if result is None or not result.HasPreciousOutput(): self.tmpfile.Dispose()
|
||||
if not result.HasPreciousOutput(): self.tmpfile.Dispose()
|
||||
self.tmpfile = None
|
||||
|
||||
def GetCommand(self):
|
||||
|
@ -117,8 +117,6 @@ class ProgressIndicator(object):
|
||||
start = time.time()
|
||||
output = case.Run()
|
||||
case.duration = (time.time() - start)
|
||||
except BreakNowException:
|
||||
self.terminate = True
|
||||
except IOError, e:
|
||||
assert self.terminate
|
||||
return
|
||||
@ -320,12 +318,6 @@ PROGRESS_INDICATORS = {
|
||||
# --- F r a m e w o r k ---
|
||||
# -------------------------
|
||||
|
||||
class BreakNowException(Exception):
|
||||
def __init__(self, value):
|
||||
self.value = value
|
||||
def __str__(self):
|
||||
return repr(self.value)
|
||||
|
||||
|
||||
class CommandOutput(object):
|
||||
|
||||
@ -387,12 +379,9 @@ class TestCase(object):
|
||||
|
||||
def Run(self):
|
||||
self.BeforeRun()
|
||||
result = None;
|
||||
result = "exception"
|
||||
try:
|
||||
result = self.RunCommand(self.GetCommand())
|
||||
except:
|
||||
self.terminate = True;
|
||||
raise BreakNowException("Used pressed CTRL+C or IO went wrong")
|
||||
finally:
|
||||
self.AfterRun(result)
|
||||
return result
|
||||
@ -713,12 +702,7 @@ class Context(object):
|
||||
|
||||
def RunTestCases(cases_to_run, progress, tasks):
|
||||
progress = PROGRESS_INDICATORS[progress](cases_to_run)
|
||||
result = 0;
|
||||
try:
|
||||
result = progress.Run(tasks)
|
||||
except Exception, e:
|
||||
print "\n", e
|
||||
return result
|
||||
return progress.Run(tasks)
|
||||
|
||||
|
||||
def BuildRequirements(context, requirements, mode, scons_flags):
|
||||
|
Loading…
Reference in New Issue
Block a user