Commit b884171c authored by Vincent Pelletier's avatar Vincent Pelletier

Move "lock" calls outside of "try" block: if "lock" call raises, there are...

Move "lock" calls outside of "try" block: if "lock" call raises, there are chances "unlock" call from "finally" will also raise, and hide original exception.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@326 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 283c8d07
......@@ -358,8 +358,8 @@ class MTClientConnection(ClientConnection):
self._lock = lock = RLock()
self.acquire = lock.acquire
self.release = lock.release
try:
self.lock()
try:
super(MTClientConnection, self).__init__(*args, **kwargs)
finally:
self.unlock()
......@@ -409,8 +409,8 @@ class MTServerConnection(ServerConnection):
self._lock = lock = RLock()
self.acquire = lock.acquire
self.release = lock.release
try:
self.lock()
try:
super(MTServerConnection, self).__init__(*args, **kwargs)
finally:
self.unlock()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment