From 9d39b135f4f84239787b0901d06a4f370a82d4bb Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 4 Apr 2021 04:40:19 -0400 Subject: Modernize code to use f-strings This also removes the encoding on the top, since Python 3 does it by default. It also changes some methods to use `yield from`. --- discord/gateway.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'discord/gateway.py') diff --git a/discord/gateway.py b/discord/gateway.py index 210a8822..17801ee1 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """ The MIT License (MIT) @@ -162,8 +160,8 @@ class KeepAliveHandler(threading.Thread): except KeyError: msg = self.block_msg else: - stack = traceback.format_stack(frame) - msg = '%s\nLoop thread traceback (most recent call last):\n%s' % (self.block_msg, ''.join(stack)) + stack = ''.join(traceback.format_stack(frame)) + msg = f'{self.block_msg}\nLoop thread traceback (most recent call last):\n{stack}' log.warning(msg, self.shard_id, total) except Exception: -- cgit v1.2.3