Remove the now useless Queue wrapper in slixmpp.util.

This commit is contained in:
Emmanuel Gil Peyrot 2014-09-21 19:28:13 +02:00 committed by Florent Le Coz
parent 06de587ed2
commit 61f89eef2e
7 changed files with 8 additions and 22 deletions

View file

@ -1,9 +1,9 @@
import socket
import threading
import logging
from queue import Queue
from slixmpp.stanza import Iq
from slixmpp.util import Queue
from slixmpp.exceptions import XMPPError

View file

@ -8,8 +8,7 @@
import socket
import threading
from slixmpp.util import Queue
from queue import Queue
class TestLiveSocket(object):

View file

@ -7,8 +7,7 @@
"""
import socket
from slixmpp.util import Queue
from queue import Queue
class TestSocket(object):

View file

@ -7,10 +7,10 @@
"""
import unittest
from queue import Queue
from xml.parsers.expat import ExpatError
from slixmpp import ClientXMPP, ComponentXMPP
from slixmpp.util import Queue
from slixmpp.stanza import Message, Iq, Presence
from slixmpp.test import TestSocket, TestLiveSocket
from slixmpp.xmlstream import ET

View file

@ -13,15 +13,3 @@
from slixmpp.util.misc_ops import bytes, unicode, hashes, hash, \
num_to_bytes, bytes_to_num, quote, \
XOR
# =====================================================================
# Standardize import of Queue class:
try:
import queue
except ImportError:
import Queue as queue
Queue = queue.Queue
QueueEmpty = queue.Empty

View file

@ -10,8 +10,8 @@
"""
import logging
from queue import Queue, Empty
from slixmpp.util import Queue, QueueEmpty
from slixmpp.xmlstream.handler.base import BaseHandler
@ -59,7 +59,7 @@ class Collector(BaseHandler):
try:
while True:
results.append(self._payload.get(False))
except QueueEmpty:
except Empty:
pass
self.stream().remove_handler(self.name)

View file

@ -10,8 +10,8 @@
"""
import logging
from queue import Queue, Empty
from slixmpp.util import Queue, QueueEmpty
from slixmpp.xmlstream.handler.base import BaseHandler
@ -71,7 +71,7 @@ class Waiter(BaseHandler):
try:
stanza = self._payload.get(True, 1)
break
except QueueEmpty:
except Empty:
elapsed_time += 1
if elapsed_time >= timeout:
log.warning("Timed out waiting for %s", self.name)