packaging: use with open() instead of try/finally: close
diff --git a/Lib/packaging/tests/test_command_install_dist.py b/Lib/packaging/tests/test_command_install_dist.py
index a06d1f6..1974a2f 100644
--- a/Lib/packaging/tests/test_command_install_dist.py
+++ b/Lib/packaging/tests/test_command_install_dist.py
@@ -193,11 +193,8 @@
         # 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