moved release lock to before return response

This commit is contained in:
fros4943 2007-10-23 09:46:28 +00:00
parent 217056b8bd
commit 474edac0f5

View file

@ -282,11 +282,12 @@ class Shepherd:
debug(Debug, response.toprettyxml())
if response.documentElement.tagName == 'error':
raise chakana.error.CoojaError(response)
self._connectionLock.release()
return response
except socket.error:
debug(MajorEvent, 'Socket error catched')
finally:
self._connectionLock.release()
except AttributeError:
debug(MajorEvent, 'Attribute error catched')
def readFromCooja(self):
# XXX: Assume message ends with a newline