From a0934246d3ee4061e93805d056759f3f40ec45de Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 30 Dec 2002 22:36:09 +0000 Subject: 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. --- Lib/Queue.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Lib/Queue.py') diff --git a/Lib/Queue.py b/Lib/Queue.py index 39c86f2cea..83a8318f52 100644 --- a/Lib/Queue.py +++ b/Lib/Queue.py @@ -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() -- cgit v1.2.1