Skip to content

Commit 79430f6

Browse files
committed
Fixes for Python 3
1 parent 858275a commit 79430f6

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

direct/src/actor/Actor.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -566,27 +566,24 @@ def __updateSortedLODNames(self):
566566
# and sort them every time somebody asks for the list
567567
self.__sortedLODNames = self.__partBundleDict.keys()
568568
# Reverse sort the doing a string->int
569-
def sortFunc(x, y):
569+
def sortKey(x):
570570
if not str(x).isdigit():
571571
smap = {'h':3,
572572
'm':2,
573573
'l':1,
574574
'f':0}
575575

576576
"""
577-
sx = smap.get(x[0],None)
578-
sy = smap.get(y[0],None)
577+
sx = smap.get(x[0], None)
579578
580579
if sx is None:
581580
self.notify.error('Invalid lodName: %s' % x)
582-
if sy is None:
583-
self.notify.error('Invalid lodName: %s' % y)
584581
"""
585-
return cmp(smap[y[0]], smap[x[0]])
582+
return smap[x[0]]
586583
else:
587-
return cmp (int(y), int(x))
584+
return int(x)
588585

589-
self.__sortedLODNames.sort(sortFunc)
586+
self.__sortedLODNames.sort(key=sortKey, reverse=True)
590587

591588
def getLODNames(self):
592589
"""

direct/src/interval/FunctionInterval.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ def __init__(self, function, **kw):
5757
self.function = function
5858

5959
# Create a unique name for the interval if necessary
60-
if (name == None):
60+
if name is None:
6161
name = self.makeUniqueName(function)
62-
assert isinstance(name, types.StringType)
62+
assert isinstance(name, str)
63+
6364
# Record any arguments
6465
self.extraArgs = extraArgs
6566
self.kw = kw

0 commit comments

Comments
 (0)