Dont allow a failure to exec() downloaded metadata source plugins to prevent metadata download from working

This commit is contained in:
Kovid Goyal 2018-09-11 07:09:01 +05:30
parent 3766f43360
commit 90ee3a5987
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -59,8 +59,12 @@ def patch_search_engines(src):
global current_search_engines
src = src.encode('utf-8')
ns = {}
exec(src, ns)
mcv = ns.get('minimum_calibre_version')
try:
exec(src, ns)
except Exception:
mcv = None
else:
mcv = ns.get('minimum_calibre_version')
if mcv is None or mcv > numeric_version:
return
cv = ns.get('current_version')