From ae4a9ae39010b1a46cfecbc03e444a19c09e605b Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 6 Nov 2020 23:50:45 -0800 Subject: [PATCH] Fix RarExists glob check not looking in workdir, moveto. --- rarpar.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rarpar.py b/rarpar.py index e345b26..dc117d7 100644 --- a/rarpar.py +++ b/rarpar.py @@ -292,7 +292,12 @@ def rarpar( else: basename = basename.format(timestamp=timestamp) - existing = winglob.glob(f'{basename}*.rar') + existing = None + if workdir: + existing = existing or workdir.glob(f'{basename}*.rar') + if moveto: + existing = existing or moveto.glob(f'{basename}*.rar') + if existing: raise RarExists(f'{existing[0]} already exists.')