diff --git a/ChangeLog b/ChangeLog index 45fc86c8..dba61660 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-02-05 Fatih Aşıcı + * pisi/version.py (compare): Allow comparing Version objects + with strings. + 2010-02-04 Ozan Çağlayan * pisi/pxml/autoxml.py (format): Some optional elements may be None during formatting, handle those situations. We still have a formatting diff --git a/pisi/version.py b/pisi/version.py index f851bd91..da1deae7 100644 --- a/pisi/version.py +++ b/pisi/version.py @@ -182,6 +182,10 @@ class Version: not we use the comparison operator. And we iterate to the left. The result is, 0 if two are equal, -1 if self < rhs, and +1 if self>rhs""" + + if isinstance(ver, basestring): + ver = pisi.version.Version(ver) + lhs = self.comps rhs = ver.comps # pad the short version string with zeros