Skip to content

Commit

Permalink
fix: Failed when SESSION_STORAGE_FILE(optional) wasn't provided
Browse files Browse the repository at this point in the history
  • Loading branch information
proffapt committed Jul 22, 2023
1 parent 020eec4 commit 9c9941f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/iitkgp_erp_login/erp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class ErpLoginError(Exception):
def login(headers, session, ERPCREDS=None, OTP_CHECK_INTERVAL=None, LOGGING=False, SESSION_STORAGE_FILE=None):
global sessionToken
ssoToken = None
if len(sys.argv) == 1 and sys.argv[0] == '-c':
caller_file = None
else:
if len(sys.argv) == 1 and sys.argv[0] == '-c':
caller_file = None
else:
caller_file = inspect.getframeinfo(inspect.currentframe().f_back).filename
token_file = f"{get_import_location(caller_file)}/{SESSION_STORAGE_FILE}" if SESSION_STORAGE_FILE else None
token_file = f"{get_import_location(caller_file)}/{SESSION_STORAGE_FILE}" if SESSION_STORAGE_FILE else ""
if SESSION_STORAGE_FILE:
try:
with open(token_file, "r") as file:
Expand Down

0 comments on commit 9c9941f

Please sign in to comment.