Skip to content

Commit

Permalink
LDAPObject.read_s() now returns None instead of raising ldap.NO_SUCH_…
Browse files Browse the repository at this point in the history
…OBJECT in case the search operation returned emtpy result.
  • Loading branch information
stroeder committed Aug 8, 2015
1 parent b4410ce commit 983bf24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Released 2.4.21 2015-07-xx
Changes since 2.4.20:

Lib/
* LDAPObject.read_s() now returns None instead of raising
ldap.NO_SUCH_OBJECT in case the search operation returned emtpy result.

----------------------------------------------------------------
Released 2.4.20 2015-07-07
Expand Down Expand Up @@ -1185,4 +1187,4 @@ Released 2.0.0pre02 2002-02-01
----------------------------------------------------------------
Released 1.10alpha3 2000-09-19

$Id: CHANGES,v 1.351 2015/08/08 13:36:30 stroeder Exp $
$Id: CHANGES,v 1.352 2015/08/08 13:37:41 stroeder Exp $
4 changes: 2 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.146 2015/06/11 15:13:43 stroeder Exp $
\$Id: ldapobject.py,v 1.147 2015/08/08 13:37:41 stroeder Exp $
Compability:
- Tested with Python 2.0+ but should work with Python 1.5.x
Expand Down Expand Up @@ -695,7 +695,7 @@ def read_s(self,dn,filterstr=None,attrlist=None,serverctrls=None,clientctrls=Non
if r:
return r[0][1]
else:
raise ldap.NO_SUCH_OBJECT('Empty search result reading entry %s' % (repr(dn)))
return None

def read_subschemasubentry_s(self,subschemasubentry_dn,attrs=None):
"""
Expand Down

0 comments on commit 983bf24

Please sign in to comment.