From 087f7f15a676df57af0cb5fb6f63cd0a169ce0bd Mon Sep 17 00:00:00 2001 From: kanewi11 Date: Thu, 24 Nov 2022 15:01:29 +0300 Subject: [PATCH] fix move session to unnecessary dir --- reactionbot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reactionbot.py b/reactionbot.py index 32cd5e1..4bb8ed8 100644 --- a/reactionbot.py +++ b/reactionbot.py @@ -113,10 +113,12 @@ async def try_convert(session_path: Path, config: Dict): try: await convertor.convert() except OperationalError: - await convertor.move_file_to_unnecessary(session_path) + if session_path.exists(): + await convertor.move_file_to_unnecessary(session_path) for suffix in CONFIG_FILE_SUFFIXES: config_file_path = session_path.with_suffix(suffix) - await convertor.move_file_to_unnecessary(config_file_path) + if config_file_path.exists(): + await convertor.move_file_to_unnecessary(config_file_path) logging.warning('Preservation of the session failed ' + session_path.stem)