diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2015-06-08 13:08:43 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2015-06-08 13:08:43 +0300 |
commit | 07d51141aeaeb8445413fe0cd62510fe374c3d26 (patch) | |
tree | 06f99559d511482eae221aa2d48f9db2c278ce0f | |
parent | 87629b2a7443f1b2bf41062aec5054ab1123ca83 (diff) |
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.
-rw-r--r-- | release/scripts/modules/addon_utils.py | 7 |
1 files changed, 6 insertions, 1 deletions
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) |