From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 8 Jun 2026 20:04:02 +0000 (+0200) Subject: [3.15] gh-150633: Minor improvement of a newly added test (GH-151103) (#151106) X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=eeba22190522a26d3847da1383e976871adff6ca;p=thirdparty%2FPython%2Fcpython.git [3.15] gh-150633: Minor improvement of a newly added test (GH-151103) (#151106) gh-150633: Minor improvement of a newly added test (GH-151103) Minor improvement of a newly added test. (cherry picked from commit fccf67a35449920484ea11d8a16566b58b0c4519) Co-authored-by: Barry Warsaw --- diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index f8e77fc7c532..9f3df8010d32 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -367,11 +367,11 @@ class ImportTests(unittest.TestCase): 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):