From 8270912c399c3218b0b9f28fae7638a17024efea Mon Sep 17 00:00:00 2001 From: "U-timeyyy-PC\\timeyyy" Date: Tue, 24 Nov 2015 11:07:27 +0100 Subject: [PATCH] applied fix from david-hughes, solves issue #97 and #47 Update fails during second update requiring admin rights under Windowssaf --- esky/finder.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/esky/finder.py b/esky/finder.py index 20061ef..2bdf081 100644 --- a/esky/finder.py +++ b/esky/finder.py @@ -123,6 +123,12 @@ def _workdir(self,app,nm,create=True): updir = app._get_update_dir() workdir = os.path.join(updir,nm) if create: + # the failure of this may raise an error which notifies us to try root access + if os.path.exists(workdir) and len(os.listdir(workdir)) == 0: + try: + os.rmdir(workdir) + except OSError: + raise for target in (updir,workdir): try: os.mkdir(target)