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.
This commit is contained in:
Guido van Rossum 2002-12-30 22:36:09 +00:00
parent 2969233f9a
commit a0934246d3
2 changed files with 7 additions and 7 deletions

View file

@ -16,7 +16,10 @@ class Queue:
If maxsize is <= 0, the queue size is infinite.
"""
import thread
try:
import thread
except ImportError:
import dummy_thread as thread
self._init(maxsize)
self.mutex = thread.allocate_lock()
self.esema = thread.allocate_lock()