Index: Tools/webchecker/wsgui.py =================================================================== --- Tools/webchecker/wsgui.py (revision 63597) +++ Tools/webchecker/wsgui.py (working copy) @@ -10,7 +10,7 @@ import websucker import os import threading -import queue +import Queue import time VERBOSE = 2 @@ -139,7 +139,7 @@ def go(self, event=None): if not self.msgq: - self.msgq = queue.Queue(0) + self.msgq = Queue.Queue(0) self.check_msgq() if not self.sucker: self.sucker = SuckerThread(self.msgq) Index: Doc/library/queue.rst =================================================================== --- Doc/library/queue.rst (revision 63597) +++ Doc/library/queue.rst (working copy) @@ -1,18 +1,17 @@ -:mod:`queue` --- A synchronized queue class +:mod:`Queue` --- A synchronized queue class =========================================== .. module:: Queue - :synopsis: Old name for the queue module. - -.. module:: queue :synopsis: A synchronized queue class. .. note:: - The :mod:`Queue` module has been renamed to :mod:`queue` in Python 3.0. It - is importable under both names in Python 2.6 and the rest of the 2.x series. + The :mod:`Queue` module has been renamed to `queue` in Python 3.0. + The :term:`2to3` tool will automatically adapt imports when converting + your sources to 3.0. -The :mod:`queue` module implements multi-producer, multi-consumer queues. + +The :mod:`Queue` module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads. The :class:`Queue` class in this module implements all the required locking semantics. It depends on the Index: Doc/library/threading.rst =================================================================== --- Doc/library/threading.rst (revision 63597) +++ Doc/library/threading.rst (working copy) @@ -8,7 +8,7 @@ This module constructs higher-level threading interfaces on top of the lower level :mod:`thread` module. -See also the :mod:`mutex` and :mod:`queue` modules. +See also the :mod:`mutex` and :mod:`Queue` modules. The :mod:`dummy_threading` module is provided for situations where :mod:`threading` cannot be used because :mod:`thread` is missing. Index: Lib/idlelib/rpc.py =================================================================== --- Lib/idlelib/rpc.py (revision 63597) +++ Lib/idlelib/rpc.py (working copy) @@ -35,7 +35,7 @@ import struct import cPickle as pickle import threading -import queue +import Queue import traceback import copy_reg import types @@ -117,8 +117,8 @@ #----------------- end class RPCServer -------------------- objecttable = {} -request_queue = queue.Queue(0) -response_queue = queue.Queue(0) +request_queue = Queue.Queue(0) +response_queue = Queue.Queue(0) class SocketIO(object): @@ -413,7 +413,7 @@ # send queued response if there is one available try: qmsg = response_queue.get(0) - except queue.Empty: + except Queue.Empty: pass else: seq, response = qmsg Index: Lib/idlelib/run.py =================================================================== --- Lib/idlelib/run.py (revision 63597) +++ Lib/idlelib/run.py (working copy) @@ -5,7 +5,7 @@ import traceback import thread import threading -import queue +import Queue import CallTips import AutoComplete @@ -85,7 +85,7 @@ continue try: seq, request = rpc.request_queue.get(block=True, timeout=0.05) - except queue.Empty: + except Queue.Empty: continue method, args, kwargs = request ret = method(*args, **kwargs) Index: Lib/lib-old/Queue.py =================================================================== --- Lib/lib-old/Queue.py (revision 63597) +++ Lib/lib-old/Queue.py (working copy) @@ -1,8 +0,0 @@ -import sys -from warnings import warnpy3k - -warnpy3k("the Queue module has been renamed " - "to 'queue' in Python 3.0", stacklevel=2) - -import queue -sys.modules[__name__] = queue Index: Lib/test/test_socket.py =================================================================== --- Lib/test/test_socket.py (revision 63597) +++ Lib/test/test_socket.py (working copy) @@ -9,7 +9,7 @@ import thread, threading import time import traceback -import queue +import Queue import sys import os import array @@ -96,7 +96,7 @@ self.server_ready = threading.Event() self.client_ready = threading.Event() self.done = threading.Event() - self.queue = queue.Queue(1) + self.queue = Queue.Queue(1) # Do some munging to start the client test. methodname = self.id() Index: Lib/test/test_py3kwarn.py =================================================================== --- Lib/test/test_py3kwarn.py (revision 63597) +++ Lib/test/test_py3kwarn.py (working copy) @@ -215,7 +215,7 @@ class TestStdlibRenames(unittest.TestCase): - renames = {'Queue': 'queue', + renames = { 'ConfigParser': 'configparser', } Index: Lib/test/test_queue.py =================================================================== --- Lib/test/test_queue.py (revision 63597) +++ Lib/test/test_queue.py (working copy) @@ -1,6 +1,6 @@ -# Some simple queue module tests, plus some failure conditions +# Some simple Queue module tests, plus some failure conditions # to ensure the Queue locks remain stable. -import queue +import Queue import sys import threading import time @@ -107,12 +107,12 @@ try: q.put("full", block=0) self.fail("Didn't appear to block with a full queue") - except queue.Full: + except Queue.Full: pass try: q.put("full", timeout=0.01) self.fail("Didn't appear to time-out with a full queue") - except queue.Full: + except Queue.Full: pass # Test a blocking put self.do_blocking_test(q.put, ("full",), q.get, ()) @@ -124,12 +124,12 @@ try: q.get(block=0) self.fail("Didn't appear to block with an empty queue") - except queue.Empty: + except Queue.Empty: pass try: q.get(timeout=0.01) self.fail("Didn't appear to time-out with an empty queue") - except queue.Empty: + except Queue.Empty: pass # Test a blocking get self.do_blocking_test(q.get, (), q.put, ('empty',)) @@ -191,13 +191,13 @@ class QueueTest(BaseQueueTest): - type2test = queue.Queue + type2test = Queue.Queue class LifoQueueTest(BaseQueueTest): - type2test = queue.LifoQueue + type2test = Queue.LifoQueue class PriorityQueueTest(BaseQueueTest): - type2test = queue.PriorityQueue + type2test = Queue.PriorityQueue @@ -205,21 +205,21 @@ class FailingQueueException(Exception): pass -class FailingQueue(queue.Queue): +class FailingQueue(Queue.Queue): def __init__(self, *args): self.fail_next_put = False self.fail_next_get = False - queue.Queue.__init__(self, *args) + Queue.Queue.__init__(self, *args) def _put(self, item): if self.fail_next_put: self.fail_next_put = False raise FailingQueueException, "You Lose" - return queue.Queue._put(self, item) + return Queue.Queue._put(self, item) def _get(self): if self.fail_next_get: self.fail_next_get = False raise FailingQueueException, "You Lose" - return queue.Queue._get(self) + return Queue.Queue._get(self) class FailingQueueTest(unittest.TestCase, BlockingTestMixin): Index: Lib/test/test_dummy_thread.py =================================================================== --- Lib/test/test_dummy_thread.py (revision 63597) +++ Lib/test/test_dummy_thread.py (working copy) @@ -7,7 +7,7 @@ """ import dummy_thread as _thread import time -import queue +import Queue import random import unittest from test import test_support @@ -124,7 +124,7 @@ """Use to test _thread.start_new_thread() passes args properly.""" queue.put((arg1, arg2)) - testing_queue = queue.Queue(1) + testing_queue = Queue.Queue(1) _thread.start_new_thread(arg_tester, (testing_queue, True, True)) result = testing_queue.get() self.failUnless(result[0] and result[1], @@ -148,7 +148,7 @@ queue.put(_thread.get_ident()) thread_count = 5 - testing_queue = queue.Queue(thread_count) + testing_queue = Queue.Queue(thread_count) if test_support.verbose: print print "*** Testing multiple thread creation "\