about summary refs log tree commit diff stats
path: root/ranger/gui/displayable.py
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2017-01-26 06:13:29 +0100
committernfnty <git@nfnty.se>2017-01-26 06:15:32 +0100
commitc78ee48d36bac7fe76ae500ed3aa3f5e20a9f74b (patch)
treefd97912d9036f876de2552b96f9ab301550faea8 /ranger/gui/displayable.py
parentc557a1ce33edad3aecedb0e84cbb84ccdde45b30 (diff)
downloadranger-c78ee48d36bac7fe76ae500ed3aa3f5e20a9f74b.tar.gz
Only use `hasattr` where absolutely needed
Use `try-except` when it's an explicit error.

Fixes #780
Diffstat (limited to 'ranger/gui/displayable.py')
-rw-r--r--ranger/gui/displayable.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py
index 926fd857..1f4b7397 100644
--- a/ranger/gui/displayable.py
+++ b/ranger/gui/displayable.py
@@ -103,8 +103,7 @@ class Displayable(  # pylint: disable=too-many-instance-attributes
 
     def destroy(self):
         """Called when the object is destroyed."""
-        if hasattr(self, 'win'):
-            del self.win
+        self.win = None
 
     def contains_point(self, y, x):
         """Test whether the point lies inside this object.