Raise proper exception when given a bad DN attribute.

This commit is contained in:
Rob Crittenden 2012-08-15 16:30:24 -04:00 committed by Martin Kosek
parent 9ab599bcba
commit bb5788fc7e

View File

@ -809,7 +809,10 @@ last, after all sets and adds."""),
value = None
if ldap.has_dn_syntax(attr):
value = DN(value)
try:
value = DN(value)
except ValueError:
raise errors.InvalidSyntax(attr=attr)
if attr in newdict:
if type(value) in (tuple,):