Skip to content

Commit ec9703b

Browse files
author
stroeder
committed
Fixed reraising of wrong exception in SimpleLDAPObject._ldap_call()
1 parent 206a10b commit ec9703b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGES

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Released 2.4.45 2017-09-xx
44
Changes since 2.4.44:
55

66
Lib/
7+
* Fixed reraising of wrong exception in SimpleLDAPObject._ldap_call()
8+
(thanks to Aigars Grins)
79

810
Tests/
911
* removed work-around in t_cext.py
@@ -1511,4 +1513,4 @@ Released 2.0.0pre02 2002-02-01
15111513
----------------------------------------------------------------
15121514
Released 1.10alpha3 2000-09-19
15131515

1514-
$Id: CHANGES,v 1.468 2017/10/09 14:40:48 stroeder Exp $
1516+
$Id: CHANGES,v 1.469 2017/10/09 14:54:10 stroeder Exp $

Lib/ldap/ldapobject.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
See https://www.python-ldap.org/ for details.
55
6-
\$Id: ldapobject.py,v 1.165 2017/09/04 14:59:12 stroeder Exp $
6+
\$Id: ldapobject.py,v 1.166 2017/10/09 14:54:10 stroeder Exp $
77
88
Compability:
99
- Tested with Python 2.0+ but should work with Python 1.5.x
@@ -112,14 +112,15 @@ def _ldap_call(self,func,*args,**kwargs):
112112
finally:
113113
self._ldap_object_lock.release()
114114
except LDAPError, e:
115+
exc_type,exc_value,exc_traceback = sys.exc_info()
115116
try:
116117
if not e.args[0].has_key('info') and e.args[0].has_key('errno'):
117118
e.args[0]['info'] = strerror(e.args[0]['errno'])
118119
except IndexError:
119120
pass
120121
if __debug__ and self._trace_level>=2:
121122
self._trace_file.write('=> LDAPError - %s: %s\n' % (e.__class__.__name__,str(e)))
122-
raise
123+
raise exc_type,exc_value,exc_traceback
123124
else:
124125
if __debug__ and self._trace_level>=2:
125126
if not diagnostic_message_success is None:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy