mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
packaging: use with open() instead of try/finally: close
This commit is contained in:
parent
0e3f3a7076
commit
21a9c748aa
11 changed files with 41 additions and 69 deletions
|
@ -193,11 +193,8 @@ class InstallTestCase(support.TempdirManager,
|
|||
# let's check the record file was created with four
|
||||
# lines, one for each .dist-info entry: METADATA,
|
||||
# INSTALLER, REQUSTED, RECORD
|
||||
f = open(cmd.record)
|
||||
try:
|
||||
with open(cmd.record) as f:
|
||||
self.assertEqual(len(f.readlines()), 4)
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
# XXX test that fancy_getopt is okay with options named
|
||||
# record and no-record but unrelated
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue