make try-except-finally works with python 2.4
darcs-hash:20080821191734-86b55-88b99be3d4535aa935d28a4869d654401b9e0a23.gz
This commit is contained in:
@@ -674,15 +674,16 @@ class JCLComponent(Component, object):
|
||||
name="TimerThread")
|
||||
timer_thread.start()
|
||||
try:
|
||||
while (self.running and self.stream
|
||||
and not self.stream.eof
|
||||
and self.stream.socket is not None):
|
||||
self.stream.loop_iter(JCLComponent.timeout)
|
||||
if self.queue.qsize():
|
||||
raise self.queue.get(0)
|
||||
except socket.error, e:
|
||||
self.__logger.info("Connection failed, restarting.")
|
||||
return (True, 5)
|
||||
try:
|
||||
while (self.running and self.stream
|
||||
and not self.stream.eof
|
||||
and self.stream.socket is not None):
|
||||
self.stream.loop_iter(JCLComponent.timeout)
|
||||
if self.queue.qsize():
|
||||
raise self.queue.get(0)
|
||||
except socket.error, e:
|
||||
self.__logger.info("Connection failed, restarting.")
|
||||
return (True, 5)
|
||||
finally:
|
||||
self.running = False
|
||||
timer_thread.join(JCLComponent.timeout)
|
||||
|
||||
Reference in New Issue
Block a user