Skip to content

Commit 9f4045f

Browse files
authored
Fixed Windows Asyncio RuntimeError
1 parent 2fa6496 commit 9f4045f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
import triangular_arbitrage.detector as detector
77

88
if __name__ == "__main__":
9+
if hasattr(asyncio, "WindowsSelectorEventLoopPolicy"):
10+
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) # Windows handles asynchronous event loops
11+
912
benchmark = os_util.parse_boolean_environment_var("IS_BENCHMARKING", "False")
1013
if benchmark:
1114
import time

0 commit comments

Comments
 (0)