diff options
author | Jakub Stasiak <jakub@stasiak.at> | 2014-10-16 09:22:41 +0100 |
---|---|---|
committer | Jakub Stasiak <jakub@stasiak.at> | 2014-10-16 09:22:41 +0100 |
commit | 9fc46249800aa24b3d1879daff4cd96d1c60166d (patch) | |
tree | c85f3e4b1331fce001f953e98412629c85ec52f3 | |
parent | a08040fb2b152067f5417a66509c06782834eaa7 (diff) | |
download | eventlet-gh-137-max-recursion-depth-in-del.tar.gz |
Condense this conditionalgh-137-max-recursion-depth-in-del
-rw-r--r-- | eventlet/greenio.py | 9 |
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): |