Remove eval from from run_hook

small improvement to remove eval using builtin function `getattr`.
This commit is contained in:
vrde 2013-09-16 21:26:55 +02:00
parent 01349f6528
commit 32abe2dd04
1 changed files with 5 additions and 4 deletions

View File

@ -466,10 +466,11 @@ class ElectrumWindow(QMainWindow):
for p in self.plugins:
if not p.is_enabled():
continue
try:
f = eval('p.'+name)
except:
continue
f = getattr(p, name, None)
if not callable(f):
return
try:
apply(f, args)
except: