Skip to content

Commit a911820

Browse files
committed
Minor improvement of a newly added test
1 parent 54de547 commit a911820

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)