Fix handling of basename=None.

This commit is contained in:
voussoir 2021-09-16 20:50:31 -07:00
parent f245ca5eae
commit 7efdcdcdbe
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -376,7 +376,9 @@ def rarpar(
date = time.strftime('%Y-%m-%d')
timestamp = time.strftime('%Y-%m-%d_%H-%M-%S')
basename = re.sub(r'\.rar$', '', basename)
if basename is not None:
basename = re.sub(r'\.rar$', '', basename)
if not basename:
basename = f'{path.basename} ({timestamp})'
else: