diff options
Diffstat (limited to 'ranger/container/file.py')
-rw-r--r-- | ranger/container/file.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ranger/container/file.py b/ranger/container/file.py index d2daa169..6450cfe6 100644 --- a/ranger/container/file.py +++ b/ranger/container/file.py @@ -57,7 +57,8 @@ class File(FileSystemObject): try: with open(self.path, 'rb') as fobj: self._firstbytes = set(fobj.read(N_FIRST_BYTES)) - except OSError: + # IOError for Python2, OSError for Python3 + except (IOError, OSError): return None return self._firstbytes |