about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/fm.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/ranger/core/fm.py b/ranger/core/fm.py
index cef9394d..52cd83d6 100644
--- a/ranger/core/fm.py
+++ b/ranger/core/fm.py
@@ -73,11 +73,10 @@ class FM(Actions,  # pylint: disable=too-many-instance-attributes
         self.hostname = socket.gethostname()
         self.home_path = os.path.expanduser('~')
 
-        self.mimetypes = mimetypes.MimeTypes()
-        extra_files = [self.relpath('data/mime.types'), os.path.expanduser("~/.mime.types")]
-        for path in mimetypes.knownfiles + extra_files:
-            if os.path.isfile(path):
-                self.mimetypes.read(path)
+        if not mimetypes.inited:
+            extra_files = [self.relpath('data/mime.types'), os.path.expanduser("~/.mime.types")]
+            mimetypes.init(mimetypes.knownfiles + extra_files)
+        self.mimetypes = mimetypes
 
     def initialize(self):  # pylint: disable=too-many-statements
         """If ui/bookmarks are None, they will be initialized here."""