Skip to content

Commit

Permalink
LDAPObject.unbind_ext_s() now ignores AttributeError in case _trace_f…
Browse files Browse the repository at this point in the history
…ile has no flush() method
  • Loading branch information
stroeder committed Nov 17, 2016
1 parent d8ada28 commit 5c7740a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Released 2.4.28 2016-11-xx
Changes since 2.4.27:

Lib/
* LDAPObject.unbind_ext_s() now ignores AttributeError
in case _trace_file has no flush() method
* added dummy method logging_file_class.flush() because
LDAPObject.unbind_ext_s() invokes it

Expand Down Expand Up @@ -1291,4 +1293,4 @@ Released 2.0.0pre02 2002-02-01
----------------------------------------------------------------
Released 1.10alpha3 2000-09-19

$Id: CHANGES,v 1.395 2016/11/11 14:42:18 stroeder Exp $
$Id: CHANGES,v 1.396 2016/11/17 12:08:30 stroeder Exp $
7 changes: 5 additions & 2 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.156 2016/07/24 16:22:32 stroeder Exp $
\$Id: ldapobject.py,v 1.157 2016/11/17 12:08:30 stroeder Exp $
Compability:
- Tested with Python 2.0+ but should work with Python 1.5.x
Expand Down Expand Up @@ -636,7 +636,10 @@ def unbind_ext_s(self,serverctrls=None,clientctrls=None):
result = self.result3(msgid,all=1,timeout=self.timeout)
else:
result = None
self._trace_file.flush()
try:
self._trace_file.flush()
except AttributeError:
pass
return result

def unbind(self):
Expand Down

0 comments on commit 5c7740a

Please sign in to comment.