[svn r38398] for setup/teardown pairs the correct idiom is

setup()
    try:
        ...
    finally:
        teardown()

and not to do the setup() within the try,
because if that raises, teardown() will
likely go wrong as well etc.

--HG--
branch : trunk
This commit is contained in:
hpk
2007-02-10 18:00:58 +01:00
parent 1739ba4f55
commit 1095cec0dc

View File

@@ -22,8 +22,8 @@ class RunExecutor(object):
def run(self, capture=True):
if capture:
self.item.startcapture()
try:
self.item.startcapture()
self.item.run()
finally:
self.item.finishcapture()