From 6475530f65de141f32e46311b852ecc385a62be7 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 10 May 2016 23:07:16 +1000 Subject: [PATCH] Removed use of eval --- Scripts/enhancer.py | 2 +- Scripts/pildriver.py | 2 +- Scripts/thresholder.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Scripts/enhancer.py b/Scripts/enhancer.py index 6393c983f..bf79dfe48 100644 --- a/Scripts/enhancer.py +++ b/Scripts/enhancer.py @@ -39,7 +39,7 @@ class Enhance(Frame): s.pack() def update(self, value): - self.value = eval(value) + self.value = float(value) self.tkim.paste(self.enhancer.enhance(self.value)) # diff --git a/Scripts/pildriver.py b/Scripts/pildriver.py index 318584ad1..cc425ad08 100644 --- a/Scripts/pildriver.py +++ b/Scripts/pildriver.py @@ -208,7 +208,7 @@ class PILDriver(object): Process the top image with the given filter. """ from PIL import ImageFilter - imageFilter = eval("ImageFilter." + self.do_pop().upper()) + imageFilter = getattr(ImageFilter, self.do_pop().upper()) image = self.do_pop() self.push(image.filter(imageFilter)) diff --git a/Scripts/thresholder.py b/Scripts/thresholder.py index bfeebfa9f..50c4bbcd2 100644 --- a/Scripts/thresholder.py +++ b/Scripts/thresholder.py @@ -42,7 +42,7 @@ class UI(Frame): # self.redraw() def update_scale(self, value): - self.value = eval(value) + self.value = float(value) self.redraw()