Skip to content

Commit

Permalink
fixed errno-related ldap.TIMEOUT regression
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder committed May 29, 2017
1 parent 663a276 commit 0e0c191
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Released 2.4.39 2017-05-xx

Changes since 2.4.38:

Lib/
* fixed errno-related ldap.TIMEOUT regression

Lib/slapdtest.py
* Removed obsolete assert statements

----------------------------------------------------------------
Released 2.4.38 2017-04-28

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

$Id: CHANGES,v 1.444 2017/04/28 20:03:52 stroeder Exp $
$Id: CHANGES,v 1.446 2017/05/29 09:00:15 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.162 2017/04/27 08:40:10 stroeder Exp $
\$Id: ldapobject.py,v 1.163 2017/05/29 09:00:15 stroeder Exp $
Compability:
- Tested with Python 2.0+ but should work with Python 1.5.x
Expand Down Expand Up @@ -112,8 +112,11 @@ def _ldap_call(self,func,*args,**kwargs):
finally:
self._ldap_object_lock.release()
except LDAPError, e:
if not e.args[0].has_key('info') and e.args[0].has_key('errno'):
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'])
except IndexError:
pass
if __debug__ and self._trace_level>=2:
self._trace_file.write('=> LDAPError - %s: %s\n' % (e.__class__.__name__,str(e)))
raise
Expand Down

0 comments on commit 0e0c191

Please sign in to comment.