use exists() instead of isFile

pull/13/head
Inex Code 2022-08-18 01:13:06 +04:00
parent 87c036de7f
commit e5584e0e1c
1 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ class WriteUserData(object):
self.userdata_file = open(TOKENS_FILE, "r+", encoding="utf-8")
elif file_type == UserDataFiles.JOBS:
# Make sure file exists
if not os.path.isfile(JOBS_FILE):
if not os.path.exists(JOBS_FILE):
with open(JOBS_FILE, "w", encoding="utf-8") as jobs_file:
jobs_file.write("{}")
self.userdata_file = open(JOBS_FILE, "r+", encoding="utf-8")
@ -70,7 +70,7 @@ class ReadUserData(object):
self.userdata_file = open(TOKENS_FILE, "r", encoding="utf-8")
elif file_type == UserDataFiles.JOBS:
# Make sure file exists
if not os.path.isfile(JOBS_FILE):
if not os.path.exists(JOBS_FILE):
with open(JOBS_FILE, "w", encoding="utf-8") as jobs_file:
jobs_file.write("{}")
self.userdata_file = open(JOBS_FILE, "r", encoding="utf-8")