Remove the now useless Queue wrapper in slixmpp.util.
This commit is contained in:
parent
06de587ed2
commit
61f89eef2e
7 changed files with 8 additions and 22 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
|
||||
import socket
|
||||
import threading
|
||||
|
||||
from slixmpp.util import Queue
|
||||
from queue import Queue
|
||||
|
||||
|
||||
class TestLiveSocket(object):
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
"""
|
||||
|
||||
import socket
|
||||
|
||||
from slixmpp.util import Queue
|
||||
from queue import Queue
|
||||
|
||||
|
||||
class TestSocket(object):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue