From 640bf42206f212dbd61baa764680390102f9b13c Mon Sep 17 00:00:00 2001 From: benoitc Date: Wed, 1 Jan 2014 16:27:06 +0100 Subject: [PATCH] don't send wsgi.errors twice and remove spurious print --- gunicorn/http/wsgi.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gunicorn/http/wsgi.py b/gunicorn/http/wsgi.py index c891cfde..32bf80dc 100644 --- a/gunicorn/http/wsgi.py +++ b/gunicorn/http/wsgi.py @@ -47,18 +47,17 @@ class WSGIErrorsWraper(io.RawIOBase): def __init__(self, cfg): errorlog = logging.getLogger("gunicorn.error") + handlers = errorlog.handlers self.streams = [] if cfg.errorlog == "-": self.streams.append(sys.stderr) + handlers = handlers[1:] - for h in errorlog.handlers: + for h in handlers: if hasattr(h, "stream"): self.streams.append(h.stream) - if not self.streams: - self.streams.append(sys.stderr) - def write(self, data): for stream in self.streams: try: @@ -191,8 +190,6 @@ def create(req, sock, client, server, cfg): # override the environ with the correct remote and server address if # we are behind a proxy using the proxy protocol. environ.update(proxy_environ(req)) - - print(environ) return resp, environ