From 932bc110cf4a653941685b617f8dcb1ec2223ca7 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Thu, 6 Mar 2025 14:48:11 -0800 Subject: [PATCH] Remove notes about new-style classes On py3, everything's new-style! Change-Id: I1b9d2a3369279a56962b800c27edd9f6127ef0d4 --- swift/common/http_protocol.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/swift/common/http_protocol.py b/swift/common/http_protocol.py index c803cce05b..cce7a9ebd4 100644 --- a/swift/common/http_protocol.py +++ b/swift/common/http_protocol.py @@ -31,8 +31,7 @@ class SwiftHttpProtocol(wsgi.HttpProtocol): # See https://github.com/eventlet/eventlet/pull/590 self.pre_shutdown_bugfix_eventlet = not getattr( websocket.WebSocketWSGI, '_WSGI_APP_ALWAYS_IDLE', None) - # Note this is not a new-style class, so super() won't work - wsgi.HttpProtocol.__init__(self, *args, **kwargs) + super().__init__(*args, **kwargs) def log_request(self, *a): """ @@ -213,16 +212,14 @@ class SwiftHttpProtocol(wsgi.HttpProtocol): return environ def _read_request_line(self): - # Note this is not a new-style class, so super() won't work - got = wsgi.HttpProtocol._read_request_line(self) + got = super()._read_request_line() # See https://github.com/eventlet/eventlet/pull/590 if self.pre_shutdown_bugfix_eventlet: self.conn_state[2] = wsgi.STATE_REQUEST return got def handle_one_request(self): - # Note this is not a new-style class, so super() won't work - got = wsgi.HttpProtocol.handle_one_request(self) + got = super().handle_one_request() # See https://github.com/eventlet/eventlet/pull/590 if self.pre_shutdown_bugfix_eventlet: if self.conn_state[2] != wsgi.STATE_CLOSE:

AltStyle によって変換されたページ (->オリジナル) /