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=''):
87
87
# properly.
88
88
fd , raw_path = tempfile .mkstemp (suffix = suffix )
89
89
try :
90
- os .write (fd , reader ())
91
- os .close (fd )
90
+ try :
91
+ os .write (fd , reader ())
92
+ finally :
93
+ os .close (fd )
92
94
del reader
93
95
yield pathlib .Path (raw_path )
94
96
finally :
95
97
try :
96
98
os .remove (raw_path )
97
- except ( FileNotFoundError , PermissionError ) :
99
+ except FileNotFoundError :
98
100
pass
99
101
100
102
Original file line number Diff line number Diff line change @@ -1516,6 +1516,7 @@ TESTSUBDIRS= ctypes/test \
1516
1516
test/test_importlib/namespace_pkgs/project3/parent/child \
1517
1517
test/test_importlib/namespacedata01 \
1518
1518
test/test_importlib/partial \
1519
+ test/test_importlib/resources \
1519
1520
test/test_importlib/source \
1520
1521
test/test_importlib/zipdata01 \
1521
1522
test/test_importlib/zipdata02 \
You can’t perform that action at this time.
0 commit comments