Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4e4833e

Browse files
committed
fix temporary folder cleanup on exit
When using mkdtemp, the dir content cleanup must be done by the user.
1 parent 6004e9b commit 4e4833e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

IPython/core/interactiveshell.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import os
2222
import re
2323
import runpy
24+
import shutil
2425
import subprocess
2526
import sys
2627
import tempfile
@@ -3902,7 +3903,7 @@ def atexit_operations(self):
39023903
del self.tempfiles
39033904
for tdir in self.tempdirs:
39043905
try:
3905-
tdir.rmdir()
3906+
shutil.rmtree(tdir)
39063907
self.tempdirs.remove(tdir)
39073908
except FileNotFoundError:
39083909
pass

0 commit comments

Comments
 (0)