Fixed odm loop error

This commit is contained in:
bender
2023-01-26 22:00:41 -05:00
parent 572341c431
commit 1d58b6f50f
4 changed files with 22 additions and 41 deletions
+2 -2
View File
@@ -80,5 +80,5 @@ for folder in sorted(os.listdir(main_directory)):
print(f"Error processing {folder}: {e}")
#Archive everything except chapters_list.py
if folder_path != "chapters_list.py":
shutil.move(folder_path, archive/ + folder)
if os.path.isdir(folder_path) and folder != 'chapters_list.py':
shutil.move(folder_path, archive + '/' + folder)