diff --git a/Lib/ldap/dn.py b/Lib/ldap/dn.py index 45950e5..569b296 100644 --- a/Lib/ldap/dn.py +++ b/Lib/ldap/dn.py @@ -3,7 +3,7 @@ See http://www.python-ldap.org/ for details. -\$Id: dn.py,v 1.15 2016/07/24 15:43:03 stroeder Exp $ +\$Id: dn.py,v 1.16 2016/07/24 15:58:26 stroeder Exp $ Compability: - Tested with Python 2.0+ @@ -110,14 +110,14 @@ def explode_rdn(rdn,notypes=0,flags=0): return ['='.join((atype,escape_dn_chars(avalue or ''))) for atype,avalue,dummy in rdn_decomp] -def is_dn(s): +def is_dn(s,flags=0): """ Returns True is `s' can be parsed by ldap.dn.str2dn() like as a distinguished host_name (DN), otherwise False is returned. """ try: - str2dn(s) - except Exception, err: + str2dn(s,flags) + except Exception: return False else: return True