commit 746982b001f10d98c686ebf923171c5f4cedfc6b parent c2c81aaeae66039d1264147da87ab1da613a63c2 Author: Sheng <webmaster0115@gmail.com> Date: Wed, 17 Oct 2018 19:34:09 +0800 Use method format instead of % Diffstat:
M | webssh/handler.py | | | 5 | ++--- |
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/webssh/handler.py b/webssh/handler.py @@ -45,9 +45,8 @@ class MixinHandler(object): def initialize(self): if self.is_forbidden(): - self.request.connection.stream.write( - b'%s 403 Forbidden\r\n\r\n' % to_bytes(self.request.version) - ) + result = '{} 403 Forbidden\r\n\r\n'.format(self.request.version) + self.request.connection.stream.write(to_bytes(result)) self.request.connection.close() raise ValueError('Accesss denied')