git://git.novaco.in
/
electrum-nvc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
01349f6
)
Remove eval from from run_hook
author
vrde
<agranzot@gmail.com>
Mon, 16 Sep 2013 19:26:55 +0000 (21:26 +0200)
committer
vrde
<agranzot@gmail.com>
Mon, 16 Sep 2013 19:26:55 +0000 (21:26 +0200)
small improvement to remove eval using builtin function `getattr`.
gui/gui_classic/main_window.py
patch
|
blob
|
history
diff --git
a/gui/gui_classic/main_window.py
b/gui/gui_classic/main_window.py
index
36085ba
..
7cddbbf
100644
(file)
--- a/
gui/gui_classic/main_window.py
+++ b/
gui/gui_classic/main_window.py
@@
-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: