server/repository.py
changeset 10608 7fc548d9dd8e
parent 10589 7c23b7de2b8d
child 10609 e2d8e81bfe68
--- a/server/repository.py	Tue Sep 15 14:59:06 2015 +0200
+++ b/server/repository.py	Tue Sep 15 15:07:13 2015 +0200
@@ -30,12 +30,13 @@
 __docformat__ = "restructuredtext en"
 
 import threading
-import Queue
 from warnings import warn
 from itertools import chain
 from time import time, localtime, strftime
 from contextlib import contextmanager
 
+from six.moves import queue
+
 from logilab.common.decorators import cached, clear_cache
 from logilab.common.deprecation import deprecated
 
@@ -199,7 +200,7 @@
     def init_cnxset_pool(self):
         """should be called bootstrap_repository, as this is what it does"""
         config = self.config
-        self._cnxsets_pool = Queue.Queue()
+        self._cnxsets_pool = queue.Queue()
         # 0. init a cnxset that will be used to fetch bootstrap information from
         #    the database
         self._cnxsets_pool.put_nowait(self.system_source.wrapped_connection())
@@ -379,7 +380,7 @@
     def _get_cnxset(self):
         try:
             return self._cnxsets_pool.get(True, timeout=5)
-        except Queue.Empty:
+        except queue.Empty:
             raise Exception('no connections set available after 5 secs, probably either a '
                             'bug in code (too many uncommited/rolled back '
                             'connections) or too much load on the server (in '