diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2014-05-26 10:09:16 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2014-05-26 10:09:16 -0700 |
commit | 2bcc68021870f134a8c8740c404b6c37d429b42b (patch) | |
tree | 1a7bb225a9637ca45e0b2a0fcc60f01e4efc4448 | |
parent | 7f6509635b580b60b662494fbc5dca91b5f722e0 (diff) | |
download | redis-py-2bcc68021870f134a8c8740c404b6c37d429b42b.tar.gz |
it's ok if max_connections is a long.
-rwxr-xr-x | redis/connection.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/redis/connection.py b/redis/connection.py index 623f44d..a7a2b69 100755 --- a/redis/connection.py +++ b/redis/connection.py @@ -765,7 +765,7 @@ class ConnectionPool(object): connection_class. """ max_connections = max_connections or 2 ** 31 - if not isinstance(max_connections, int) or max_connections < 0: + if not isinstance(max_connections, (int, long)) or max_connections < 0: raise ValueError('"max_connections" must be a positive integer') self.connection_class = connection_class @@ -867,16 +867,12 @@ class BlockingConnectionPool(ConnectionPool): connection_class=Connection, queue_class=LifoQueue, **connection_kwargs): - if not isinstance(max_connections, int) or max_connections < 0: - raise ValueError('"max_connections" must be a positive integer') - - self.connection_class = connection_class - self.connection_kwargs = connection_kwargs self.queue_class = queue_class - self.max_connections = max_connections self.timeout = timeout - - self.reset() + super(BlockingConnectionPool, self).__init__( + connection_class=connection_class, + max_connections=max_connections, + **connection_kwargs) def reset(self): self.pid = os.getpid() |