Use a recursive lock for safe_atexit

This commit is contained in:
Kovid Goyal 2025-04-05 12:36:17 +05:30
parent d2154e66dc
commit 0282410b15
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -10,12 +10,12 @@ import sys
import time import time
from contextlib import suppress from contextlib import suppress
from functools import wraps from functools import wraps
from threading import Lock from threading import RLock
_plat = sys.platform.lower() _plat = sys.platform.lower()
iswindows = 'win32' in _plat or 'win64' in _plat iswindows = 'win32' in _plat or 'win64' in _plat
lock = Lock() lock = RLock()
worker = None worker = None
RMTREE_ACTION = 'rmtree' RMTREE_ACTION = 'rmtree'
UNLINK_ACTION = 'unlink' UNLINK_ACTION = 'unlink'