mirror of
https://github.com/python/cpython
synced 2024-10-02 12:30:05 +00:00
only close non-None files
This commit is contained in:
parent
feb5149244
commit
aa6f688bd4
|
@ -241,6 +241,7 @@ def test_load_module_extension_file_is_None(self):
|
||||||
# Issue #15902
|
# Issue #15902
|
||||||
name = '_heapq'
|
name = '_heapq'
|
||||||
found = imp.find_module(name)
|
found = imp.find_module(name)
|
||||||
|
if found[0] is not None:
|
||||||
found[0].close()
|
found[0].close()
|
||||||
if found[2][2] != imp.C_EXTENSION:
|
if found[2][2] != imp.C_EXTENSION:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue