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