summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2014-03-03 14:28:08 -0800
committerGuido van Rossum <guido@python.org>2014-03-03 14:28:08 -0800
commitcc5a129d2789a1eba6e3b83a2db3f1b91d3b2f2c (patch)
treedaab06daabc40e081ce2aa83f80d136412dd8c43 /examples
parent5f6649b7c72824f32082922170f6e5ef5d1d7b92 (diff)
downloadtrollius-cc5a129d2789a1eba6e3b83a2db3f1b91d3b2f2c.tar.gz
Use public interfaces to get the fileno(). Fix a typo.
Diffstat (limited to 'examples')
-rw-r--r--examples/crawl.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/crawl.py b/examples/crawl.py
index 637fb8e..da654cb 100644
--- a/examples/crawl.py
+++ b/examples/crawl.py
@@ -116,7 +116,7 @@ class ConnectionPool:
and recycle_connection() puts it back in. To recycle a
connection, call conn.close(recycle=True).
- There are limits to both the overal pool and the per-key pool.
+ There are limits to both the overall pool and the per-key pool.
"""
def __init__(self, log, max_pool=10, max_tasks=5):
@@ -244,14 +244,14 @@ class Connection:
self.key = None
def stale(self):
- return self.reader is None or self.reader._eof
+ return self.reader is None or self.reader.at_eof()
def fileno(self):
writer = self.writer
if writer is not None:
- transport = writer._transport
+ transport = writer.transport
if transport is not None:
- sock = transport._sock
+ sock = transport.get_extra_info('socket')
if sock is not None:
return sock.fileno()
return None