Message235581
| Author |
martin.panter |
| Recipients |
Valery.Khamenya, docs@python, eric.araujo, ezio.melotti, javawizard, martin.panter, ncoghlan, orsenthil, terry.reedy |
| Date |
2015年02月09日.01:22:12 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1423444937.6.0.576881580862.issue12955@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Here is a patch to change the urlopen() examples to use context managers where appropriate.
There were also a few examples of handling HTTPError which I didn’t touch, because the whole file object versus exception object thing is probably a separate can of worms. |
|