eventlet v0.22 changed HttpProtocol.__init__
From eventlet v0.22, HttpProtocol.__init__ signature was changed to take 4 argument to 3 argument. The changeset of eventlet, 7f53465578543156e7251e243c0636e087a8445f, https://github.com/eventlet/eventlet/issues/188 changed it. So try the new signature for HttpProtocol.__init__ first, and then fallback to the old signature for compatibility. Change-Id: I2e024f04ceab10afb20b5a402f8ba8dfd50e753d
This commit is contained in:
parent
4749941f88
commit
2c31f7f351
|
@ -390,9 +390,21 @@ class UnixDomainHttpProtocol(eventlet.wsgi.HttpProtocol):
|
|||
def __init__(self, request, client_address, server):
|
||||
if not client_address:
|
||||
client_address = ('<local>', 0)
|
||||
# base class is old-style, so super does not work properly
|
||||
eventlet.wsgi.HttpProtocol.__init__(self, request, client_address,
|
||||
server)
|
||||
|
||||
# NOTE(yamahata): from eventlet v0.22 HttpProtocol.__init__
|
||||
# signature was changed by changeset of
|
||||
# 7f53465578543156e7251e243c0636e087a8445f
|
||||
# try the new signature first, and then fallback to the old
|
||||
# signature for compatibility
|
||||
try:
|
||||
conn_state = [client_address, request, eventlet.wsgi.STATE_CLOSE]
|
||||
# base class is old-style, so super does not work properly
|
||||
eventlet.wsgi.HttpProtocol.__init__(self, conn_state, server)
|
||||
except (AttributeError, TypeError):
|
||||
# AttributeError: missing STATE_CLOSE
|
||||
# TypeError: signature mismatch
|
||||
eventlet.wsgi.HttpProtocol.__init__(
|
||||
self, request, client_address, server)
|
||||
|
||||
|
||||
class UnixDomainWSGIServer(wsgi.Server):
|
||||
|
|
Loading…
Reference in New Issue