From 4d552e82ce9de98453f77e3dff192000f121e682 Mon Sep 17 00:00:00 2001 From: Padraic Fanning Date: Sun, 23 May 2021 20:14:35 -0400 Subject: [PATCH] Re-add threadless builds --- Lib/tempfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/tempfile.py b/Lib/tempfile.py index 8f9cb6c3c..927d9ca07 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -45,7 +45,11 @@ import errno as _errno from random import Random as _Random import sys as _sys import weakref as _weakref -import _thread + +try: + import _thread +except ImportError: + import _dummy_thread as _thread _allocate_lock = _thread.allocate_lock _text_openflags = _os.O_RDWR | _os.O_CREAT | _os.O_EXCL