From ce310afabc6312f91bc7b6d6f3603994f8b8c268 Mon Sep 17 00:00:00 2001 From: h4llow3En Date: Sun, 8 Nov 2015 23:39:52 +0100 Subject: [PATCH] hopefully securely fixed updater --- tdo/todolist/maintenance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tdo/todolist/maintenance.py b/tdo/todolist/maintenance.py index af76e16..e8135b0 100644 --- a/tdo/todolist/maintenance.py +++ b/tdo/todolist/maintenance.py @@ -50,14 +50,14 @@ def update(): with zipfile.ZipFile('dl.zip', "r") as z: z.extractall(".") os.remove('dl.zip') - newdir = '' + newdir = None for entry in os.listdir(): if re.match(r'{user}\-tdo\-.*'.format(user=user), entry): newdir = entry os.chdir(newdir) subprocess.call(['python3', './setup.py', 'install']) os.chdir('..') - if newdir != '': + if newdir is not None: shutil.rmtree(newdir) except AttributeError: