Skip to content

Commit

Permalink
LDAPObject.unbind_ext_s() invokes LDAPObject._trace_file.flush() only…
Browse files Browse the repository at this point in the history
… if LDAPObject._trace_level is non-zero and Python is running in debug mode
  • Loading branch information
stroeder committed Nov 18, 2016
1 parent 84ca4eb commit 946fe3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
9 changes: 6 additions & 3 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ Released 2.4.28 2016-11-17
Changes since 2.4.27:

Lib/
* LDAPObject.unbind_ext_s() invokes LDAPObject._trace_file.flush()
only if LDAPObject._trace_level is non-zero and Python is running
in debug mode
* LDAPObject.unbind_ext_s() now ignores AttributeError
in case _trace_file has no flush() method
* added dummy method logging_file_class.flush() because
in case LDAPObject._trace_file has no flush() method
* added dummy method ldap.logger.logging_file_class.flush() because
LDAPObject.unbind_ext_s() invokes it

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

$Id: CHANGES,v 1.397 2016/11/17 12:08:59 stroeder Exp $
$Id: CHANGES,v 1.398 2016/11/18 07:01:45 stroeder Exp $
11 changes: 6 additions & 5 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.157 2016/11/17 12:08:30 stroeder Exp $
\$Id: ldapobject.py,v 1.158 2016/11/18 07:01:45 stroeder Exp $
Compability:
- Tested with Python 2.0+ but should work with Python 1.5.x
Expand Down Expand Up @@ -636,10 +636,11 @@ def unbind_ext_s(self,serverctrls=None,clientctrls=None):
result = self.result3(msgid,all=1,timeout=self.timeout)
else:
result = None
try:
self._trace_file.flush()
except AttributeError:
pass
if __debug__ and self._trace_level>=1:
try:
self._trace_file.flush()
except AttributeError:
pass
return result

def unbind(self):
Expand Down

0 comments on commit 946fe3f

Please sign in to comment.