mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
only close non-None files
This commit is contained in:
parent
feb5149244
commit
aa6f688bd4
1 changed files with 2 additions and 1 deletions
|
|
@ -241,7 +241,8 @@ class ImportTests(unittest.TestCase):
|
|||
# Issue #15902
|
||||
name = '_heapq'
|
||||
found = imp.find_module(name)
|
||||
found[0].close()
|
||||
if found[0] is not None:
|
||||
found[0].close()
|
||||
if found[2][2] != imp.C_EXTENSION:
|
||||
return
|
||||
imp.load_module(name, None, *found[1:])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue