File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -66,14 +66,19 @@ jobs:
6666 run : pip install MetaTrader5
6767
6868 - name : Run Python inline script
69+ shell : pwsh
6970 run : |
70- python -c "import MetaTrader5 as mt5; import time; print('Testing MT5 initialization...'); import sys ; \
71+ python -c "import MetaTrader5 as mt5; import time; import sys; print('Testing MT5 initialization...'); success = False ; \
7172for attempt in range(12) : \
7273 if mt5.initialize() : \
7374 print('MT5 initialized successfully'); \
7475 mt5.shutdown(); \
75- sys.exit(0); \
76+ success = True; \
77+ break; \
7678 else : \
7779 print(f'Attempt {attempt+1} : Not ready yet, sleeping...'); \
7880 time.sleep(5); \
79- print('Failed to initialize MT5 after waiting.'); sys.exit(1)"
81+ if not success : \
82+ print('Failed to initialize MT5 after waiting.'); \
83+ sys.exit(1)"
84+
You can’t perform that action at this time.
0 commit comments