diff options
| author | Guido van Rossum <guido@python.org> | 2014-03-03 14:28:08 -0800 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 2014-03-03 14:28:08 -0800 |
| commit | cc5a129d2789a1eba6e3b83a2db3f1b91d3b2f2c (patch) | |
| tree | daab06daabc40e081ce2aa83f80d136412dd8c43 /examples | |
| parent | 5f6649b7c72824f32082922170f6e5ef5d1d7b92 (diff) | |
| download | trollius-cc5a129d2789a1eba6e3b83a2db3f1b91d3b2f2c.tar.gz | |
Use public interfaces to get the fileno(). Fix a typo.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/crawl.py | 8 |
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 |
