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

Commit

Permalink
Trac #33213: remove SAGE_TMP from tmp_dir() and tmp_filename().
Browse files Browse the repository at this point in the history
These two functions will now use whatever python decides is the
appropriate place for temporary files on the system.
  • Loading branch information
orlitzky committed Feb 15, 2022
1 parent 3c8c0e6 commit 3db8444
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/sage/misc/temporary_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ def tmp_dir(name="dir_", ext=""):
0
sage: f.close()
"""
from sage.misc.misc import SAGE_TMP
tmp = tempfile.mkdtemp(prefix=name, suffix=ext, dir=str(SAGE_TMP))
tmp = tempfile.mkdtemp(prefix=name, suffix=ext)
name = os.path.abspath(tmp)
return name + os.sep

Expand Down Expand Up @@ -146,8 +145,7 @@ def tmp_filename(name="tmp_", ext=""):
0
sage: f.close()
"""
from sage.misc.misc import SAGE_TMP
handle, tmp = tempfile.mkstemp(prefix=name, suffix=ext, dir=str(SAGE_TMP))
handle, tmp = tempfile.mkstemp(prefix=name, suffix=ext)
os.close(handle)
name = os.path.abspath(tmp)
return name
Expand Down

0 comments on commit 3db8444

Please sign in to comment.