diff options
Diffstat (limited to 'eventlet/greenio.py')
-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): |