File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -87,14 +87,16 @@ def _tempfile(reader, suffix=''):
8787 # properly.
8888 fd , raw_path = tempfile .mkstemp (suffix = suffix )
8989 try :
90- os .write (fd , reader ())
91- os .close (fd )
90+ try :
91+ os .write (fd , reader ())
92+ finally :
93+ os .close (fd )
9294 del reader
9395 yield pathlib .Path (raw_path )
9496 finally :
9597 try :
9698 os .remove (raw_path )
97- except ( FileNotFoundError , PermissionError ) :
99+ except FileNotFoundError :
98100 pass
99101
100102
Original file line number Diff line number Diff line change @@ -1516,6 +1516,7 @@ TESTSUBDIRS= ctypes/test \
15161516 test/test_importlib/namespace_pkgs/project3/parent/child \
15171517 test/test_importlib/namespacedata01 \
15181518 test/test_importlib/partial \
1519+ test/test_importlib/resources \
15191520 test/test_importlib/source \
15201521 test/test_importlib/zipdata01 \
15211522 test/test_importlib/zipdata02 \
You can’t perform that action at this time.
0 commit comments