mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
don't send wsgi.errors twice and remove spurious print
This commit is contained in:
parent
ee08ac8644
commit
640bf42206
@ -47,18 +47,17 @@ class WSGIErrorsWraper(io.RawIOBase):
|
|||||||
|
|
||||||
def __init__(self, cfg):
|
def __init__(self, cfg):
|
||||||
errorlog = logging.getLogger("gunicorn.error")
|
errorlog = logging.getLogger("gunicorn.error")
|
||||||
|
handlers = errorlog.handlers
|
||||||
self.streams = []
|
self.streams = []
|
||||||
|
|
||||||
if cfg.errorlog == "-":
|
if cfg.errorlog == "-":
|
||||||
self.streams.append(sys.stderr)
|
self.streams.append(sys.stderr)
|
||||||
|
handlers = handlers[1:]
|
||||||
|
|
||||||
for h in errorlog.handlers:
|
for h in handlers:
|
||||||
if hasattr(h, "stream"):
|
if hasattr(h, "stream"):
|
||||||
self.streams.append(h.stream)
|
self.streams.append(h.stream)
|
||||||
|
|
||||||
if not self.streams:
|
|
||||||
self.streams.append(sys.stderr)
|
|
||||||
|
|
||||||
def write(self, data):
|
def write(self, data):
|
||||||
for stream in self.streams:
|
for stream in self.streams:
|
||||||
try:
|
try:
|
||||||
@ -191,8 +190,6 @@ def create(req, sock, client, server, cfg):
|
|||||||
# override the environ with the correct remote and server address if
|
# override the environ with the correct remote and server address if
|
||||||
# we are behind a proxy using the proxy protocol.
|
# we are behind a proxy using the proxy protocol.
|
||||||
environ.update(proxy_environ(req))
|
environ.update(proxy_environ(req))
|
||||||
|
|
||||||
print(environ)
|
|
||||||
return resp, environ
|
return resp, environ
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user