From ba3da6ab7cc24e76e2e889790d1d104691436310 Mon Sep 17 00:00:00 2001 From: jeancf Date: Sat, 28 Mar 2020 11:21:28 +0100 Subject: [PATCH] Handled exception of video download directory absent when trying to delete it --- twoot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/twoot.py b/twoot.py index 06d8861..61e572f 100755 --- a/twoot.py +++ b/twoot.py @@ -529,7 +529,10 @@ def main(argv): sql.commit() # Cleanup downloaded video files - shutil.rmtree('./output/' + twit_account) + try: + shutil.rmtree('./output/' + twit_account) + except FileNotFoundError: # The directory does not exist + pass if __name__ == "__main__": main(sys.argv)