summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWouter Bolsterlee <uws@xs4all.nl>2016-03-20 22:06:00 +0100
committerWouter Bolsterlee <wouter@bolsterl.ee>2016-07-27 19:08:46 +0200
commitc67ceaab04bd197f2d37598dbfa92eba144a6cee (patch)
treeb585c790609242b962f19f7e61cd5491d1386903
parenta5b32210d07546f0eea381c6c345fd6bf353d758 (diff)
downloadhappybase-c67ceaab04bd197f2d37598dbfa92eba144a6cee.tar.gz
Use Python 3 compatible 'queue' import
-rw-r--r--happybase/pool.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/happybase/pool.py b/happybase/pool.py
index aa0da99..1ffff5a 100644
--- a/happybase/pool.py
+++ b/happybase/pool.py
@@ -4,10 +4,11 @@ HappyBase connection pool module.
import contextlib
import logging
-import Queue
import socket
import threading
+from six.moves import queue
+
from thriftpy.thrift import TException
from .connection import Connection
@@ -61,7 +62,7 @@ class ConnectionPool(object):
"Initializing connection pool with %d connections", size)
self._lock = threading.Lock()
- self._queue = Queue.LifoQueue(maxsize=size)
+ self._queue = queue.LifoQueue(maxsize=size)
self._thread_connections = threading.local()
connection_kwargs = kwargs
@@ -81,7 +82,7 @@ class ConnectionPool(object):
"""Acquire a connection from the pool."""
try:
return self._queue.get(True, timeout)
- except Queue.Empty:
+ except queue.Empty:
raise NoConnectionsAvailable(
"No connection available from pool within specified "
"timeout")