diff --git a/tools/chakana/shepherd.py b/tools/chakana/shepherd.py index ef0ce8133..3103c9dc7 100644 --- a/tools/chakana/shepherd.py +++ b/tools/chakana/shepherd.py @@ -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