diff options
author | Collin Winter <collinw@gmail.com> | 2007-09-01 23:34:30 (GMT) |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2007-09-01 23:34:30 (GMT) |
commit | c79461b1648c9209c3652184572a17eef0a76202 (patch) | |
tree | 47c6238c8c47c4881f6f0523ea86d201cea1fc94 /Doc/library/urllib2.rst | |
parent | 2ac012130549b1ef51ebce11148d01eaca1a7033 (diff) | |
download | cpython-c79461b1648c9209c3652184572a17eef0a76202.zip cpython-c79461b1648c9209c3652184572a17eef0a76202.tar.gz cpython-c79461b1648c9209c3652184572a17eef0a76202.tar.bz2 |
Partial py3k-ification of Doc/library/: convert has_key references into either 'k in d' or __contains__; normalize raise statements; convert print statements into print function calls.
Diffstat (limited to 'Doc/library/urllib2.rst')
-rw-r--r-- | Doc/library/urllib2.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/urllib2.rst b/Doc/library/urllib2.rst index 6360ab8..b3e5485 100644 --- a/Doc/library/urllib2.rst +++ b/Doc/library/urllib2.rst @@ -834,7 +834,7 @@ it:: >>> import urllib2 >>> f = urllib2.urlopen('http://www.python.org/') - >>> print f.read(100) + >>> print(f.read(100)) <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <?xml-stylesheet href="./css/ht2html @@ -846,7 +846,7 @@ installation supports SSL. :: >>> req = urllib2.Request(url='https://localhost/cgi-bin/test.cgi', ... data='This data is passed to stdin of the CGI') >>> f = urllib2.urlopen(req) - >>> print f.read() + >>> print(f.read()) Got Data: "This data is passed to stdin of the CGI" The code for the sample CGI used in the above example is:: @@ -854,7 +854,7 @@ The code for the sample CGI used in the above example is:: #!/usr/bin/env python import sys data = sys.stdin.read() - print 'Content-type: text-plain\n\nGot Data: "%s"' % data + print('Content-type: text-plain\n\nGot Data: "%s"' % data) Use of Basic HTTP Authentication:: |