Skip to content

Commit e9c7e9b

Browse files
authored
PR: Catch ValueError when trying to preload modules (#873)
1 parent 0fa74ba commit e9c7e9b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pyls/plugins/preload_imports.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,8 @@ def pyls_initialize(config):
3030
try:
3131
__import__(mod_name)
3232
log.debug("Preloaded module %s", mod_name)
33-
except ImportError:
33+
except Exception: # pylint: disable=broad-except
34+
# Catch any exception since not only ImportError can be raised here
35+
# For example, old versions of NumPy can cause a ValueError.
36+
# See spyder-ide/spyder#13985
3437
pass

0 commit comments

Comments
 (0)