updates ensure_connect decorator function

only calls _connect() if _connected is False
This commit is contained in:
Peter Sprygada 2017-01-20 22:42:20 -05:00 committed by Brian Coca
commit 83fe2170ff

View file

@ -49,7 +49,8 @@ BUFSIZE = 65536
def ensure_connect(func):
@wraps(func)
def wrapped(self, *args, **kwargs):
self._connect()
if not self._connected:
self._connect()
return func(self, *args, **kwargs)
return wrapped