]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Don't try to compute max() of an empty sequence (which throws an exception)
authorBen Darnell <bdarnell@beaker.local>
Tue, 25 May 2010 18:40:42 +0000 (11:40 -0700)
committerBen Darnell <bdarnell@beaker.local>
Tue, 25 May 2010 18:40:42 +0000 (11:40 -0700)
tornado/httpclient.py

index 899f1636c9f7816bfaddcaec2d6427f9396a13fc..75adb63a7eca06e02d25adcdb7817d221b564572 100644 (file)
@@ -226,7 +226,7 @@ class AsyncHTTPClient(object):
         for fd in exceptable:
             fds[fd] = fds.get(fd, 0) | 0x8 | 0x10
 
-        if max(fds.iterkeys()) > 900:
+        if fds and max(fds.iterkeys()) > 900:
             # Libcurl has a bug in which it behaves unpredictably with
             # file descriptors greater than 1024.  (This is because
             # even though it uses poll() instead of select(), it still