https://github.com/python/cpython/commit/fccf67a35449920484ea11d8a16566b58b0c4519
commit: fccf67a35449920484ea11d8a16566b58b0c4519
branch: main
author: Barry Warsaw <[email protected]>
committer: warsaw <[email protected]>
date: 2026-06-08T19:21:00Z
summary:

gh-150633: Minor improvement of a newly added test (#151103)

Minor improvement of a newly added test.

files:
M Lib/test/test_import/__init__.py

diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py
index f8e77fc7c532c4..9f3df8010d3233 100644
--- a/Lib/test/test_import/__init__.py
+++ b/Lib/test/test_import/__init__.py
@@ -367,11 +367,11 @@ def test_import_raises_ModuleNotFoundError(self):
     def test_import_null_byte_in_name_raises_ModuleNotFoundError(self):
         # gh-150633: module names containing null bytes should not
         # lead to duplicates in sys.modules
-        before = set(sys.modules.keys())
+        before = set(sys.modules)
         with self.assertRaises(ModuleNotFoundError):
             __import__('zipimport\x00junk')
 
-        self.assertEqual(set(sys.modules.keys()), before)
+        self.assertEqual(set(sys.modules), before)
 
     def test_from_import_missing_module_raises_ModuleNotFoundError(self):
         with self.assertRaises(ModuleNotFoundError):

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to