mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fixed mostDerivedLast compare func
This commit is contained in:
parent
7f8b3683ee
commit
882fb8fa70
@ -763,9 +763,12 @@ def mostDerivedLast(classList):
|
||||
"""pass in list of classes. sorts list in-place, with derived classes
|
||||
appearing after their bases"""
|
||||
def compare(a,b):
|
||||
if a is b:
|
||||
return 0
|
||||
if issubclass(a,b):
|
||||
return 1
|
||||
return -1
|
||||
result=1
|
||||
elif issubclass(b,a):
|
||||
result=-1
|
||||
else:
|
||||
result=0
|
||||
#print a,b,result
|
||||
return result
|
||||
classList.sort(compare)
|
||||
|
Loading…
x
Reference in New Issue
Block a user