diff --git a/pymongo/connection.py b/pymongo/connection.py index 8bacc65a1..5d54dd89a 100644 --- a/pymongo/connection.py +++ b/pymongo/connection.py @@ -113,7 +113,7 @@ def _parse_uri(uri, default_port): return (host_list, database, username, password) -class Pool(threading.local): +class _Pool(threading.local): """A simple connection pool. Uses thread-local socket per thread. By calling return_socket() a @@ -276,7 +276,7 @@ class Connection(object): # TODO support auth for pooling self.__cursor_manager = CursorManager(self) - self.__pool = Pool(self.__connect) + self.__pool = _Pool(self.__connect) self.__network_timeout = network_timeout self.__document_class = document_class @@ -513,7 +513,7 @@ class Connection(object): # TODO support auth for pooling .. seealso:: :meth:`end_request` .. versionadded:: 1.3 """ - self.__pool = Pool(self.__connect) + self.__pool = _Pool(self.__connect) self.__host = None self.__port = None diff --git a/test/test_pooling.py b/test/test_pooling.py index c3db0aed5..2a3a77512 100644 --- a/test/test_pooling.py +++ b/test/test_pooling.py @@ -24,7 +24,7 @@ sys.path[0:0] = [""] from nose.plugins.skip import SkipTest -from pymongo.connection import Pool +from pymongo.connection import _Pool from test_connection import get_connection N = 50 @@ -141,13 +141,13 @@ class TestPooling(unittest.TestCase): run_cases(self, [SaveAndFind, Disconnect, Unique]) def test_independent_pools(self): - p = Pool(None) + p = _Pool(None) self.assertEqual([], p.sockets) self.c.end_request() self.assertEqual([], p.sockets) # Sensical values aren't really important here - p1 = Pool(5) + p1 = _Pool(5) self.assertEqual(None, p.socket_factory) self.assertEqual(5, p1.socket_factory)