summaryrefslogtreecommitdiffstats
path: root/Lib/tempfile.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-12-30 22:36:09 (GMT)
committerGuido van Rossum <guido@python.org>2002-12-30 22:36:09 (GMT)
commita0934246d3ee4061e93805d056759f3f40ec45de (patch)
tree8a30d831747140f41481e092a8e55e7978ff7107 /Lib/tempfile.py
parent2969233f9af1479abb25814e5f4552e71b163bbd (diff)
downloadcpython-a0934246d3ee4061e93805d056759f3f40ec45de.zip
cpython-a0934246d3ee4061e93805d056759f3f40ec45de.tar.gz
cpython-a0934246d3ee4061e93805d056759f3f40ec45de.tar.bz2
Use the dummy_thread module in Queue.py and tempfile.py.
tempfile.py already contained code to let it run without threads present; for Queue.py this is considered a useful feature too.
Diffstat (limited to 'Lib/tempfile.py')
-rw-r--r--Lib/tempfile.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 0393ba5..d322d8f 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -50,12 +50,9 @@ except (ImportError, AttributeError):
try:
import thread as _thread
- _allocate_lock = _thread.allocate_lock
-except (ImportError, AttributeError):
- class _allocate_lock:
- def acquire(self):
- pass
- release = acquire
+except ImportError:
+ import dummy_thread as _thread
+_allocate_lock = _thread.allocate_lock
_text_openflags = _os.O_RDWR | _os.O_CREAT | _os.O_EXCL
if hasattr(_os, 'O_NOINHERIT'):