]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fixes for python 2.5
authorBen Darnell <ben@bendarnell.com>
Tue, 16 Nov 2010 05:32:51 +0000 (21:32 -0800)
committerBen Darnell <ben@bendarnell.com>
Tue, 16 Nov 2010 05:32:51 +0000 (21:32 -0800)
tornado/iostream.py
tornado/test/simple_httpclient_test.py

index 3bea7e12198c78f6c0e8ba7ee75307c94435bd57..0e95cac23d0542b1a8d4bf1df4144f533e6f70f5 100644 (file)
@@ -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)
index e8c35277a0271bf40a4fa0acd74ecaa99acae6af..479024ece64ab0853e04186bd2c998e5542971ae 100644 (file)
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 
+from __future__ import with_statement
+
 import collections
 import gzip
 import logging