mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
revert r69777 since all the experts agree that extra import lines distract from the code
This commit is contained in:
parent
5149742e8b
commit
a7b55a33f8
31 changed files with 42 additions and 96 deletions
|
@ -473,8 +473,7 @@ statement both starts a database transaction and acquires a thread lock::
|
|||
Finally, the :func:`closing(object)` function returns *object* so that it can be
|
||||
bound to a variable, and calls ``object.close`` at the end of the block. ::
|
||||
|
||||
import sys
|
||||
import urllib
|
||||
import urllib, sys
|
||||
from contextlib import closing
|
||||
|
||||
with closing(urllib.urlopen('http://www.yahoo.com')) as f:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue