[attributs] assert value is not only unicode but can also be of the specified python type

This commit is contained in:
Valentin Samir 2014-02-14 00:45:12 +01:00
parent 0486929a5a
commit aea8e9d974
2 changed files with 3 additions and 3 deletions

View file

@ -211,7 +211,7 @@ class Attr(object):
"""Crée un nouvel objet représentant un attribut."""
self.value = None
self.conn = conn
assert isinstance(val, unicode)
assert isinstance(val, unicode) or (self.python_type and isinstance(val, self.python_type))
self.parent = Parent
self.parse_value(val)