don't check cnx if we don't have one

This commit is contained in:
Mike McLean 2013-09-09 15:51:07 -04:00
parent 8ac22e6e2f
commit 4319ba0be8

View file

@ -1835,8 +1835,8 @@ class ClientSession(object):
if self._connection and self.opts.get('keepalive'):
if key == self._connection[0]:
cnx = self._connection[1]
if getattr(cnx, 'sock', None):
return cnx
if getattr(cnx, 'sock', None):
return cnx
cnx = self._cnxClass(self._host, self._port, **self._cnxOpts)
self._connection = (key, cnx)
if self._timeout_compat: