diff --git a/blenderkit/utils.py b/blenderkit/utils.py
index fde5b0025add3b7fb280fa4d304d8cc5d9956371..e0ced9b1329020ad476361d7a8584b4d4895ad44 100644
--- a/blenderkit/utils.py
+++ b/blenderkit/utils.py
@@ -285,7 +285,6 @@ def save_prefs(self, context):
             fpath = paths.BLENDERKIT_SETTINGS_FILENAME
             if not os.path.exists(paths._presets):
                 os.makedirs(paths._presets)
-            f = open(fpath, 'w')
             with open(fpath, 'w') as s:
                 json.dump(prefs, s)
         except Exception as e: