[Python-checkins] r69682 - python/branches/py3k/Lib/distutils/version.py
M.-A. Lemburg
mal at egenix.com
Mon Feb 16 19:23:50 CET 2009
On 2009年02月16日 19:22, benjamin.peterson wrote:
> Author: benjamin.peterson
> Date: Mon Feb 16 19:22:15 2009
> New Revision: 69682
>> Log:
> remove another use of cmp()
Sigh. It would be so much easier to just put this implementation somewhere
in the stdlib and reference it whenever necessary, instead of cluttering up
the whole stdlib with different versions of the same piece of code.
> Modified:
> python/branches/py3k/Lib/distutils/version.py
>> Modified: python/branches/py3k/Lib/distutils/version.py
> ==============================================================================
> --- python/branches/py3k/Lib/distutils/version.py (original)
> +++ python/branches/py3k/Lib/distutils/version.py Mon Feb 16 19:22:15 2009
> @@ -338,7 +338,12 @@
> if isinstance(other, str):
> other = LooseVersion(other)
>> - return cmp(self.version, other.version)
> + if self.version == other.version:
> + return 0
> + if self.version < other.version:
> + return -1
> + if self.version > other.version:
> + return 1
>>> # end class LooseVersion
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, Feb 16 2009)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
::: Try our new mxODBC.Connect Python Database Interface for free ! ::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
http://www.egenix.com/company/contact/
More information about the Python-checkins
mailing list