diff --git a/CHANGES b/CHANGES index a758fad..7300d01 100644 --- a/CHANGES +++ b/CHANGES @@ -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 @@ -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 $ diff --git a/Lib/ldap/ldapobject.py b/Lib/ldap/ldapobject.py index 13ea9e5..9b87787 100644 --- a/Lib/ldap/ldapobject.py +++ b/Lib/ldap/ldapobject.py @@ -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 @@ -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):