aboutsummaryrefslogtreecommitdiffstats
path: root/bot/__init__.py
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-09-24 18:54:39 +0300
committerGravatar ks129 <[email protected]>2020-09-24 18:54:39 +0300
commita3246bd40a3a496ad155d02653d3104392d9ff8e (patch)
treefffc704f2cc09c44f4727872d8ad80bad5a10ae9 /bot/__init__.py
parentTictactoe: Use __str__ instead custom display method for user/AI name display (diff)
parentMerge branch 'master' into tic-tac-toe (diff)
Merge remote-tracking branch 'origin/tic-tac-toe' into tic-tac-toe
Diffstat (limited to 'bot/__init__.py')
-rw-r--r--bot/__init__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bot/__init__.py b/bot/__init__.py
index 4729e50c..a9a0865e 100644
--- a/bot/__init__.py
+++ b/bot/__init__.py
@@ -1,3 +1,4 @@
+import asyncio
import logging
import logging.handlers
import os
@@ -36,7 +37,7 @@ os.makedirs(log_dir, exist_ok=True)
# File handler rotates logs every 5 MB
file_handler = logging.handlers.RotatingFileHandler(
- log_file, maxBytes=5*(2**20), backupCount=10)
+ log_file, maxBytes=5 * (2**20), backupCount=10)
file_handler.setLevel(logging.TRACE if Client.debug else logging.DEBUG)
# Console handler prints to terminal
@@ -63,3 +64,8 @@ logging.basicConfig(
handlers=[console_handler, file_handler]
)
logging.getLogger().info('Logging initialization complete')
+
+
+# On Windows, the selector event loop is required for aiodns.
+if os.name == "nt":
+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())