Commit 08903ab1 authored by Valentin Samir's avatar Valentin Samir

[attributs] Pas d'AssertionError en comparant un generalizedTimeFormat avec...

[attributs] Pas d'AssertionError en comparant un generalizedTimeFormat avec autre chose qu'un unicode ou un generalizedTimeFormat
parent 8372bf80
......@@ -626,9 +626,15 @@ class generalizedTimeFormat(Attr):
def __eq__(self, othertime):
if isinstance(othertime, generalizedTimeFormat):
return self._stamp == othertime._stamp
else:
elif isinstance(othertime, float):
return self._stamp == othertime
elif isinstance(othertime, int):
return self._stamp == othertime
elif isinstance(othertime, unicode) or isinstance(othertime, str):
resource = generalizedTimeFormat(othertime, conn=None, Parent=None)
return self._stamp == resource._stamp
else:
return False
def __neq__(self, othertime):
return not (self == othertime)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment