Fixed empty saved_session string
This commit is contained in:
parent
5919bebccb
commit
5326450e8e
1 changed files with 4 additions and 3 deletions
|
@ -189,12 +189,13 @@ class Client:
|
||||||
)
|
)
|
||||||
|
|
||||||
if len(saved) > 1:
|
if len(saved) > 1:
|
||||||
return cls.from_session(
|
obj = cls.from_session(
|
||||||
session=session,
|
session=session,
|
||||||
servers=saved[1:]
|
servers=saved[1:]
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
obj = cls.from_session(session)
|
obj = cls.from_session(session)
|
||||||
|
|
||||||
obj.saved_session = file
|
obj.saved_session = file
|
||||||
|
|
||||||
return obj
|
return obj
|
||||||
|
@ -281,7 +282,7 @@ class Client:
|
||||||
try:
|
try:
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
except OSError as err:
|
except OSError as err:
|
||||||
logging.warning(f'Unable to remove session file: {err}')
|
logging.warning(f'Unable to delete session file: {err}')
|
||||||
|
|
||||||
def list_servers(self, cache: bool = True) -> List[AternosServer]:
|
def list_servers(self, cache: bool = True) -> List[AternosServer]:
|
||||||
|
|
||||||
|
|
Reference in a new issue