Make the objc-runtime work with Python 2.6
llvm-svn: 161111
This commit is contained in:
parent
3cb3b0045c
commit
bbb648ef80
|
@ -522,7 +522,7 @@ class InvalidClass_Data:
|
|||
def is_valid(self):
|
||||
return 0
|
||||
|
||||
@functools.total_ordering
|
||||
|
||||
class Version:
|
||||
def __init__(self, major, minor, release, build_string):
|
||||
self._major = major
|
||||
|
@ -561,6 +561,18 @@ class Version:
|
|||
(self.release == other.release) and \
|
||||
(self.build_string == other.build_string)
|
||||
|
||||
# Python 2.6 doesn't have functools.total_ordering, so we have to implement
|
||||
# other comparators
|
||||
def __gt__(self, other):
|
||||
return other < self
|
||||
|
||||
def __le__(self, other):
|
||||
return not other < self
|
||||
|
||||
def __ge__(self, other):
|
||||
return not self < other
|
||||
|
||||
|
||||
runtime_version = lldb.formatters.cache.Cache()
|
||||
os_version = lldb.formatters.cache.Cache()
|
||||
types_caches = lldb.formatters.cache.Cache()
|
||||
|
|
Loading…
Reference in New Issue