Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 4182565

Browse files
orlitzkyMatthias Koeppe
authored andcommitted
Trac #33213: remove SAGE_TMP from tmp_dir() and tmp_filename().
These two functions will now use whatever python decides is the appropriate place for temporary files on the system.
1 parent eb1a786 commit 4182565

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/sage/misc/temporary_file.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ def tmp_dir(name="dir_", ext=""):
9696
0
9797
sage: f.close()
9898
"""
99-
from sage.misc.misc import SAGE_TMP
100-
tmp = tempfile.mkdtemp(prefix=name, suffix=ext, dir=str(SAGE_TMP))
99+
tmp = tempfile.mkdtemp(prefix=name, suffix=ext)
101100
name = os.path.abspath(tmp)
102101
return name + os.sep
103102

@@ -146,8 +145,7 @@ def tmp_filename(name="tmp_", ext=""):
146145
0
147146
sage: f.close()
148147
"""
149-
from sage.misc.misc import SAGE_TMP
150-
handle, tmp = tempfile.mkstemp(prefix=name, suffix=ext, dir=str(SAGE_TMP))
148+
handle, tmp = tempfile.mkstemp(prefix=name, suffix=ext)
151149
os.close(handle)
152150
name = os.path.abspath(tmp)
153151
return name

0 commit comments

Comments
 (0)