From 8e095020254ad33a611726c5b9d66cf1cb7ac5c1 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 14 Feb 2022 13:47:50 -0500 Subject: [PATCH] Trac #33213: don't clear SAGE_TMP upon exiting. --- src/sage/misc/temporary_file.py | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/src/sage/misc/temporary_file.py b/src/sage/misc/temporary_file.py index c7421dd0306..c7eaea734fc 100644 --- a/src/sage/misc/temporary_file.py +++ b/src/sage/misc/temporary_file.py @@ -26,38 +26,6 @@ import io import os import tempfile -import atexit - - -def delete_tmpfiles(): - """ - Remove the directory ``SAGE_TMP``. - - TESTS: - - This is automatically run when Sage exits, test this by running a - separate session of Sage:: - - sage: from sage.tests.cmdline import test_executable - sage: child_SAGE_TMP, err, ret = test_executable(["sage", "-c", "print(SAGE_TMP)"]) - sage: err, ret - ('', 0) - sage: os.path.exists(child_SAGE_TMP) # indirect doctest - False - - The parent directory should exist:: - - sage: parent_SAGE_TMP = os.path.normpath(child_SAGE_TMP + '/..') - sage: os.path.isdir(parent_SAGE_TMP) - True - """ - import shutil - from sage.misc.misc import SAGE_TMP - shutil.rmtree(str(SAGE_TMP), ignore_errors=True) - - -# Run when Python shuts down -atexit.register(delete_tmpfiles) #################################################################