From 07d51141aeaeb8445413fe0cd62510fe374c3d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 8 Jun 2015 12:08:43 +0200 Subject: 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. --- release/scripts/modules/addon_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'release/scripts') diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py index 11aeebb8a43..68efe9c1a10 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) -- cgit v1.2.3