10000 numpy/distutils/misc_util.py fix for #7809: check that _tmpdirs is no… · numpy/numpy@e65375e · GitHub
[go: up one dir, main page]

Skip to content

Commit e65375e

Browse files
committed
numpy/distutils/misc_util.py fix for #7809: check that _tmpdirs is not None
1 parent 5c80867 commit e65375e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

numpy/distutils/misc_util.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
# store all created temporary directories so they can be deleted on exit
2525
_tmpdirs = []
2626
def clean_up_temporary_directory():
27-
for d in _tmpdirs:
28-
try:
29-
shutil.rmtree(d)
30-
except OSError:
31-
pass
27+
if _tmpdirs is not None:
28+
for d in _tmpdirs:
29+
try:
30+
shutil.rmtree(d)
31+
except OSError:
32+
pass
3233

3334
atexit.register(clean_up_temporary_directory)
3435

0 commit comments

Comments
 (0)
0