Commit: 07d51141aeaeb8445413fe0cd62510fe374c3d26
Author: Sybren A. Stüvel
Date:   Mon Jun 8 12:08:43 2015 +0200
Branches: master
https://developer.blender.org/rB07d51141aeaeb8445413fe0cd62510fe374c3d26

Fix: a broken symlink to an addon resulted in a blank addon tab

The addons tab in the User Settings window would be empty, due to
a FileNotFound error. This error can be caused by a broken symlink,
which is now treated the same was as a file that misses its bl_info
dictionary.

===================================================================

M       release/scripts/modules/addon_utils.py

===================================================================

diff --git a/release/scripts/modules/addon_utils.py 
b/release/scripts/modules/addon_utils.py
index 11aeebb..68efe9c 100644
--- a/release/scripts/modules/addon_utils.py
+++ b/release/scripts/modules/addon_utils.py
@@ -74,7 +74,12 @@ def modules_refresh(module_cache=addons_fake_modules):
             print("fake_module", mod_path, mod_name)
         import ast
         ModuleType = type(ast)
-        file_mod = open(mod_path, "r", encoding='UTF-8')
+        try:
+            file_mod = open(mod_path, "r", encoding='UTF-8')
+        except OSError as e:
+            print("Error opening file %r: %s" % (mod_path, e))
+            return None
+
         if speedy:
             lines = []
             line_iter = iter(file_mod)

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to