Skip to content

Commit

Permalink
Handle removing LDAPObject._l solely in SimpleLDAPObject.unbind_ext()
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder committed Jan 28, 2016
1 parent 3784f88 commit d501574
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Lib/ldap/ldapobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
See http://www.python-ldap.org/ for details.
\$Id: ldapobject.py,v 1.152 2016/01/26 11:12:54 stroeder Exp $
\$Id: ldapobject.py,v 1.153 2016/01/28 09:43:08 stroeder Exp $
Compability:
- Tested with Python 2.0+ but should work with Python 1.5.x
Expand Down Expand Up @@ -624,7 +624,10 @@ def unbind_ext(self,serverctrls=None,clientctrls=None):
synchronous in nature
"""
res = self._ldap_call(self._l.unbind_ext,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
del self._l
try:
del self._l
except AttributeError:
pass
return res

def unbind_ext_s(self,serverctrls=None,clientctrls=None):
Expand Down Expand Up @@ -902,7 +905,6 @@ def _apply_method_s(self,func,*args,**kwargs):
return func(self,*args,**kwargs)
except ldap.SERVER_DOWN:
SimpleLDAPObject.unbind_s(self)
del self._l
# Try to reconnect
self.reconnect(self._uri,retry_max=self._retry_max,retry_delay=self._retry_delay)
# Re-try last operation
Expand Down

0 comments on commit d501574

Please sign in to comment.