aboutsummaryrefslogtreecommitdiffstats
path: root/bot/__init__.py
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-09-24 18:54:10 +0300
committerGravatar GitHub <[email protected]>2020-09-24 18:54:10 +0300
commit69d2292ec4b3fb2dc83f291ef1ed7bc86eabfd09 (patch)
treeb0c3c0991eef3fc278a0977baf129a7205ff469c /bot/__init__.py
parentMerge remote-tracking branch 'origin/tic-tac-toe' into tic-tac-toe (diff)
parentMerge pull request #456 from Anubhav1603/update_dpy (diff)
Merge branch 'master' 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())