summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Stasiak <jakub@stasiak.at>2014-10-16 09:22:41 +0100
committerJakub Stasiak <jakub@stasiak.at>2014-10-16 09:22:41 +0100
commit9fc46249800aa24b3d1879daff4cd96d1c60166d (patch)
treec85f3e4b1331fce001f953e98412629c85ec52f3
parenta08040fb2b152067f5417a66509c06782834eaa7 (diff)
downloadeventlet-gh-137-max-recursion-depth-in-del.tar.gz
Condense this conditionalgh-137-max-recursion-depth-in-del
-rw-r--r--eventlet/greenio.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/eventlet/greenio.py b/eventlet/greenio.py
index 9024fbf..f44096e 100644
--- a/eventlet/greenio.py
+++ b/eventlet/greenio.py
@@ -221,12 +221,9 @@ class GreenSocket(object):
self._closed = True
def __del__(self):
- try:
- close = self.close
- except AttributeError:
- # In case when our constructor wasn't called or didn't succeed
- pass
- else:
+ # This is in case self.close is not assigned yet (currently the constructor does it)
+ close = getattr(self, 'close', None)
+ if close is not None:
close()
def connect(self, address):