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.
This commit is contained in:
Sybren A. Stüvel 2015-06-08 12:08:43 +02:00
parent 87629b2a74
commit 07d51141ae
1 changed files with 6 additions and 1 deletions

View File

@ -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)