Remove a useless session.log warning

This fixes an error being sent when session.log doesn't exist.
This usually occurs when the logs directory is deleted.
This commit is contained in:
luukas 2022-06-14 00:16:49 +03:00
parent 55f7ab1d35
commit 0d664cfae5
No known key found for this signature in database
GPG Key ID: CC4915E8D71FC044

View File

@ -1,3 +1,4 @@
import contextlib
import os
import re
import sys
@ -491,9 +492,10 @@ class Helpers:
# del any old session.lock file as this is a new session
try:
os.remove(session_log_file)
with contextlib.suppress(FileNotFoundError):
os.remove(session_log_file)
except Exception as e:
logger.error(f"Deleting Session.lock failed with error: {e}")
Console.error(f"Deleting Session.lock failed with error: {e}")
@staticmethod
def get_time_as_string():