From b3e8b2f6ab24cdb0e22577273cccba60c393783f Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 29 Aug 2009 15:10:40 -0500 Subject: [PATCH] handle Queue renaming --HG-- branch : trunk --- py/execnet/channel.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/py/execnet/channel.py b/py/execnet/channel.py index bf479f10e..f9981fbd8 100644 --- a/py/execnet/channel.py +++ b/py/execnet/channel.py @@ -1,5 +1,8 @@ import threading, weakref, sys -import Queue +try: + import Queue as queue +except ImportError: + import queue if 'Message' not in globals(): from py.__.execnet.message import Message @@ -30,7 +33,7 @@ class Channel(object): assert isinstance(id, int) self.gateway = gateway self.id = id - self._items = Queue.Queue() + self._items = queue.Queue() self._closed = False self._receiveclosed = threading.Event() self._remoteerrors = [] @@ -48,7 +51,7 @@ class Channel(object): while 1: try: olditem = queue.get(block=False) - except Queue.Empty: + except queue.Empty: break else: if olditem is ENDMARKER: