about summary refs log tree commit diff stats
path: root/ranger/core/actions.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/core/actions.py')
-rw-r--r--ranger/core/actions.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 0298af19..aef0d205 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -978,7 +978,8 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
         if not self.settings.preview_script or not self.settings.use_preview_script:
             try:
                 return codecs.open(path, 'r', errors='ignore')
-            except OSError:
+            # IOError for Python2, OSError for Python3
+            except (IOError, OSError):
                 return None
 
         # self.previews is a 2 dimensional dict: