diff --git a/CHANGES b/CHANGES index 9e82153..2e740c0 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,8 @@ Released 2.4.45 2017-09-xx Changes since 2.4.44: Lib/ +* Fixed reraising of wrong exception in SimpleLDAPObject._ldap_call() + (thanks to Aigars Grins) Tests/ * removed work-around in t_cext.py @@ -1511,4 +1513,4 @@ Released 2.0.0pre02 2002-02-01 ---------------------------------------------------------------- Released 1.10alpha3 2000-09-19 -$Id: CHANGES,v 1.468 2017/10/09 14:40:48 stroeder Exp $ +$Id: CHANGES,v 1.469 2017/10/09 14:54:10 stroeder Exp $ diff --git a/Lib/ldap/ldapobject.py b/Lib/ldap/ldapobject.py index 1289914..6a39fa3 100644 --- a/Lib/ldap/ldapobject.py +++ b/Lib/ldap/ldapobject.py @@ -3,7 +3,7 @@ See https://www.python-ldap.org/ for details. -\$Id: ldapobject.py,v 1.165 2017/09/04 14:59:12 stroeder Exp $ +\$Id: ldapobject.py,v 1.166 2017/10/09 14:54:10 stroeder Exp $ Compability: - Tested with Python 2.0+ but should work with Python 1.5.x @@ -112,6 +112,7 @@ def _ldap_call(self,func,*args,**kwargs): finally: self._ldap_object_lock.release() except LDAPError, e: + exc_type,exc_value,exc_traceback = sys.exc_info() try: if not e.args[0].has_key('info') and e.args[0].has_key('errno'): e.args[0]['info'] = strerror(e.args[0]['errno']) @@ -119,7 +120,7 @@ def _ldap_call(self,func,*args,**kwargs): pass if __debug__ and self._trace_level>=2: self._trace_file.write('=> LDAPError - %s: %s\n' % (e.__class__.__name__,str(e))) - raise + raise exc_type,exc_value,exc_traceback else: if __debug__ and self._trace_level>=2: if not diagnostic_message_success is None: