summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2014-09-21 19:28:13 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-09-28 23:58:46 +0200
commit61f89eef2eac74821fae12e0389e58dc1a05a075 (patch)
tree715e7ae2f4dadad73f3c274c32d6283073cffeba
parent06de587ed2f7e6439fb2f67a2c64a96a757778ad (diff)
downloadslixmpp-61f89eef2eac74821fae12e0389e58dc1a05a075.tar.gz
slixmpp-61f89eef2eac74821fae12e0389e58dc1a05a075.tar.bz2
slixmpp-61f89eef2eac74821fae12e0389e58dc1a05a075.tar.xz
slixmpp-61f89eef2eac74821fae12e0389e58dc1a05a075.zip
Remove the now useless Queue wrapper in slixmpp.util.
-rw-r--r--slixmpp/plugins/xep_0047/stream.py2
-rw-r--r--slixmpp/test/livesocket.py3
-rw-r--r--slixmpp/test/mocksocket.py3
-rw-r--r--slixmpp/test/slixtest.py2
-rw-r--r--slixmpp/util/__init__.py12
-rw-r--r--slixmpp/xmlstream/handler/collector.py4
-rw-r--r--slixmpp/xmlstream/handler/waiter.py4
7 files changed, 8 insertions, 22 deletions
diff --git a/slixmpp/plugins/xep_0047/stream.py b/slixmpp/plugins/xep_0047/stream.py
index d3235972..a8e7ff2a 100644
--- a/slixmpp/plugins/xep_0047/stream.py
+++ b/slixmpp/plugins/xep_0047/stream.py
@@ -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
diff --git a/slixmpp/test/livesocket.py b/slixmpp/test/livesocket.py
index 0d189571..e7deb617 100644
--- a/slixmpp/test/livesocket.py
+++ b/slixmpp/test/livesocket.py
@@ -8,8 +8,7 @@
import socket
import threading
-
-from slixmpp.util import Queue
+from queue import Queue
class TestLiveSocket(object):
diff --git a/slixmpp/test/mocksocket.py b/slixmpp/test/mocksocket.py
index 409b377e..79961279 100644
--- a/slixmpp/test/mocksocket.py
+++ b/slixmpp/test/mocksocket.py
@@ -7,8 +7,7 @@
"""
import socket
-
-from slixmpp.util import Queue
+from queue import Queue
class TestSocket(object):
diff --git a/slixmpp/test/slixtest.py b/slixmpp/test/slixtest.py
index 5b00a2b1..4f14d721 100644
--- a/slixmpp/test/slixtest.py
+++ b/slixmpp/test/slixtest.py
@@ -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
diff --git a/slixmpp/util/__init__.py b/slixmpp/util/__init__.py
index df09f771..8f70b2bb 100644
--- a/slixmpp/util/__init__.py
+++ b/slixmpp/util/__init__.py
@@ -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
diff --git a/slixmpp/xmlstream/handler/collector.py b/slixmpp/xmlstream/handler/collector.py
index 03868187..d9e20279 100644
--- a/slixmpp/xmlstream/handler/collector.py
+++ b/slixmpp/xmlstream/handler/collector.py
@@ -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)
diff --git a/slixmpp/xmlstream/handler/waiter.py b/slixmpp/xmlstream/handler/waiter.py
index c8bc2e55..c25063db 100644
--- a/slixmpp/xmlstream/handler/waiter.py
+++ b/slixmpp/xmlstream/handler/waiter.py
@@ -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)