From: Ben Darnell Date: Tue, 16 Nov 2010 05:32:51 +0000 (-0800) Subject: Fixes for python 2.5 X-Git-Tag: v1.2.0~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b607c10badb89125118d892b176c36aacd63323;p=thirdparty%2Ftornado.git Fixes for python 2.5 --- diff --git a/tornado/iostream.py b/tornado/iostream.py index 3bea7e121..0e95cac23 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -16,6 +16,8 @@ """A utility class to write to and read from a non-blocking socket.""" +from __future__ import with_statement + import errno import logging import socket @@ -113,7 +115,7 @@ class IOStream(object): self.socket.connect(address) except socket.error, e: # In non-blocking mode connect() always raises an exception - if e.errno not in (errno.EINPROGRESS, errno.EWOULDBLOCK): + if e.args[0] not in (errno.EINPROGRESS, errno.EWOULDBLOCK): raise self._connect_callback = stack_context.wrap(callback) self._add_io_state(self.io_loop.WRITE) diff --git a/tornado/test/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py index e8c35277a..479024ece 100644 --- a/tornado/test/simple_httpclient_test.py +++ b/tornado/test/simple_httpclient_test.py @@ -1,5 +1,7 @@ #!/usr/bin/env python +from __future__ import with_statement + import collections import gzip import logging