Raise proper exception when given a bad DN attribute.

This commit is contained in:
Rob Crittenden authored and Martin Kosek committed 2012-08-16 12:52:23 +02:00
1 parent 9ab599bcba
commit bb5788fc7e
1 file changed
+4 -1
+4 -1
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,):