[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:
		
							parent
							
								
									1739ba4f55
								
							
						
					
					
						commit
						1095cec0dc
					
				| 
						 | 
					@ -22,8 +22,8 @@ class RunExecutor(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def run(self, capture=True):
 | 
					    def run(self, capture=True):
 | 
				
			||||||
        if capture:
 | 
					        if capture:
 | 
				
			||||||
            try:
 | 
					 | 
				
			||||||
            self.item.startcapture()
 | 
					            self.item.startcapture()
 | 
				
			||||||
 | 
					            try:
 | 
				
			||||||
                self.item.run()
 | 
					                self.item.run()
 | 
				
			||||||
            finally:
 | 
					            finally:
 | 
				
			||||||
                self.item.finishcapture()
 | 
					                self.item.finishcapture()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue