From a57e2ec7e6b217d4ddf3f1806c263b9bdfed1901 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Wed, 3 Feb 2010 10:41:30 +0100 Subject: [PATCH] timeout could be None. --- examples/djangotest/settings.py | 3 +++ gunicorn/util.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/djangotest/settings.py b/examples/djangotest/settings.py index 4081555b..c7400265 100755 --- a/examples/djangotest/settings.py +++ b/examples/djangotest/settings.py @@ -1,5 +1,8 @@ # Django settings for djangotest project. +import platform +PRODUCTION_MODE = platform.node().startswith('http') + DEBUG = True TEMPLATE_DEBUG = DEBUG diff --git a/gunicorn/util.py b/gunicorn/util.py index d3af4a86..c355cc52 100644 --- a/gunicorn/util.py +++ b/gunicorn/util.py @@ -80,7 +80,7 @@ def write(sock, data): def write_nonblock(sock, data): timeout = sock.gettimeout() - if sock.gettimeout() > 0.0: + if timeout != 0.0: try: sock.setblocking(0) return write(sock, data)