We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b4b7a0 commit 7ad241cCopy full SHA for 7ad241c
heudiconv/parser.py
@@ -1,3 +1,4 @@
1
+import atexit
2
import logging
3
import os
4
import os.path as op
@@ -13,9 +14,13 @@
13
14
from .utils import (
15
docstring_parameter,
16
StudySessionInfo,
17
+ TempDirs,
18
)
19
20
lgr = logging.getLogger(__name__)
21
+tempdirs = TempDirs()
22
+# Ensure they are cleaned up upon exit
23
+atexit.register(tempdirs.cleanup)
24
25
_VCS_REGEX = '%s\.(?:git|gitattributes|svn|bzr|hg)(?:%s|$)' % (op.sep, op.sep)
26
@@ -66,7 +71,7 @@ def get_extracted_dicoms(fl):
66
71
# of all files in all tarballs
67
72
68
73
# cannot use TempDirs since will trigger cleanup with __del__
69
- tmpdir = mkdtemp(prefix='heudiconvDCM')
74
+ tmpdir = tempdirs('heudiconvDCM')
70
75
76
sessions = defaultdict(list)
77
session = 0
0 commit comments