diff options
author | Guido van Rossum <guido@python.org> | 2013-10-16 11:17:08 -0700 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2013-10-16 11:17:08 -0700 |
commit | e1b8232a87411735e4dc9ccddcb387b1f461b9a0 (patch) | |
tree | 33016372032216805fe56323b514d6015adff7e0 /examples | |
parent | 71152ad5992850138c7fd2b79bc2a741011a53a4 (diff) | |
download | trollius-e1b8232a87411735e4dc9ccddcb387b1f461b9a0.tar.gz |
Fix misspelled peername in examples. Also comment out drain() call.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/fetch2.py | 2 | ||||
-rw-r--r-- | examples/fetch3.py | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/examples/fetch2.py b/examples/fetch2.py index 8badf1d..ca250d6 100644 --- a/examples/fetch2.py +++ b/examples/fetch2.py @@ -45,7 +45,7 @@ class Request: ssl=self.ssl) if self.verbose: print('* Connected to %s' % - (self.writer.get_extra_info('getpeername'),), + (self.writer.get_extra_info('peername'),), file=sys.stderr) def putline(self, line): diff --git a/examples/fetch3.py b/examples/fetch3.py index 8142f09..3b2c8ae 100644 --- a/examples/fetch3.py +++ b/examples/fetch3.py @@ -34,7 +34,7 @@ class ConnectionPool: print('* Reusing pooled connection', key, file=sys.stderr) return conn reader, writer = yield from open_connection(host, port, ssl=ssl) - host, port, *_ = writer.get_extra_info('getpeername') + host, port, *_ = writer.get_extra_info('peername') key = host, port, ssl self.connections[key] = reader, writer if self.verbose: @@ -79,13 +79,13 @@ class Request: self.port, ssl=self.ssl) self.vprint('* Connected to %s' % - (self.writer.get_extra_info('getpeername'),)) + (self.writer.get_extra_info('peername'),)) @coroutine def putline(self, line): self.vprint('>', line) self.writer.write(line.encode('latin-1') + b'\r\n') - yield from self.writer.drain() + ##yield from self.writer.drain() @coroutine def send_request(self): @@ -197,6 +197,7 @@ def fetch(url, verbose=True, max_redirect=10): if not next_url: break url = urllib.parse.urljoin(url, next_url) + print('redirect to', url, file=sys.stderr) return body |