зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1777414 - Remove Python2 specific code from our `Version` subclass r=firefox-build-system-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D151063
This commit is contained in:
Родитель
638dac8633
Коммит
934d2e7234
|
@ -57,31 +57,6 @@ class Version(LooseVersion):
|
|||
)
|
||||
)[:3]
|
||||
|
||||
def _cmp(self, other):
|
||||
# LooseVersion checks isinstance(StringType), so work around it.
|
||||
if six.PY2 and isinstance(other, six.text_type):
|
||||
other = other.encode("ascii")
|
||||
if six.PY2:
|
||||
return LooseVersion.__cmp__(self, other)
|
||||
return LooseVersion._cmp(self, other)
|
||||
|
||||
# These method definitions can be deleted when we remove support for Python
|
||||
# 2.
|
||||
def __eq__(self, other):
|
||||
return self._cmp(other) == 0
|
||||
|
||||
def __lt__(self, other):
|
||||
return self._cmp(other) < 0
|
||||
|
||||
def __le__(self, other):
|
||||
return self._cmp(other) <= 0
|
||||
|
||||
def __gt__(self, other):
|
||||
return self._cmp(other) > 0
|
||||
|
||||
def __ge__(self, other):
|
||||
return self._cmp(other) >= 0
|
||||
|
||||
|
||||
class ConfigureOutputHandler(logging.Handler):
|
||||
"""A logging handler class that sends info messages to stdout and other
|
||||
|
|
Загрузка…
Ссылка в новой задаче