From 61f6736fcb44fa971f32d2260b457b9f9e2e2dc7 Mon Sep 17 00:00:00 2001 From: Ichinga Samuel Date: Sat, 23 Nov 2024 20:31:03 +0100 Subject: [PATCH] v4.0.4 --- pyproject.toml | 2 +- src/aiomql/lib/account.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index eb56ca6..4dc2ff2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "aiomql" -version = "4.0.3" +version = "4.0.4" readme = "README.md" requires-python = ">=3.11" classifiers = [ diff --git a/src/aiomql/lib/account.py b/src/aiomql/lib/account.py index d0a6f7e..cdfe8f1 100644 --- a/src/aiomql/lib/account.py +++ b/src/aiomql/lib/account.py @@ -37,8 +37,9 @@ class Account(_Base, AccountInfo): """ await self.mt5.initialize() self.connected = await self.mt5.login() - if not self: + if not self.connected: raise LoginError("Login failed") + await self.refresh() return self async def __aexit__(self, exc_type, exc_val, exc_tb):