This commit is contained in:
Kovid Goyal 2025-04-30 08:02:23 +05:30
parent d11ea450aa
commit 6f79154dbc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -40,9 +40,12 @@ get_default_tempdir = tempfile.gettempdir
def base_dir():
global _base_dir, _prevent_recursion
if _base_dir is not None and not _prevent_recursion and not os.path.exists(_base_dir):
if _base_dir is not None and not os.path.exists(_base_dir):
# Some people seem to think that running temp file cleaners that
# delete the temp dirs of running programs is a good idea!
if _prevent_recursion:
_base_dir = get_default_tempdir()
else:
_base_dir = None
if _base_dir is None:
td = os.environ.get('CALIBRE_WORKER_TEMP_DIR', None)