Skip to content

Commit 5ccd536

Browse files
warsawmiss-islington
authored andcommitted
gh-150633: Minor improvement of a newly added test (GH-151103)
Minor improvement of a newly added test. (cherry picked from commit fccf67a) Co-authored-by: Barry Warsaw <barry@python.org>
1 parent 5751633 commit 5ccd536

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/test/test_import/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,11 @@ def test_import_raises_ModuleNotFoundError(self):
367367
def test_import_null_byte_in_name_raises_ModuleNotFoundError(self):
368368
# gh-150633: module names containing null bytes should not
369369
# lead to duplicates in sys.modules
370-
before = set(sys.modules.keys())
370+
before = set(sys.modules)
371371
with self.assertRaises(ModuleNotFoundError):
372372
__import__('zipimport\x00junk')
373373

374-
self.assertEqual(set(sys.modules.keys()), before)
374+
self.assertEqual(set(sys.modules), before)
375375

376376
def test_from_import_missing_module_raises_ModuleNotFoundError(self):
377377
with self.assertRaises(ModuleNotFoundError):

0 commit comments

Comments
 (0)