Xmlparser: check the attribute type is storable
This commit is contained in:
parent
dee6ec28fe
commit
ae3c46e693
2 changed files with 4 additions and 67 deletions
|
@ -124,7 +124,10 @@ class ModuleState:
|
|||
|
||||
def setAttribute(self, name, value):
|
||||
"""DOM like method"""
|
||||
self.attributes[name] = value
|
||||
if isinstance(value, datetime) or isinstance(value, str) or isinstance(value, int) or isinstance(value, float):
|
||||
self.attributes[name] = value
|
||||
else:
|
||||
raise TypeError("attributes must be primary type or datetime")
|
||||
|
||||
def getContent(self):
|
||||
return self.content
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue