fix for nameless functors

This commit is contained in:
David Rose 2011-06-22 21:32:23 +00:00
parent 0ffae72f88
commit d6a8731988

View File

@ -77,7 +77,7 @@ class FunctionInterval(Interval.Interval):
@staticmethod
def makeUniqueName(func, suffix = ''):
name = 'Func-%s-%d' % (func.__name__, FunctionInterval.functionIntervalNum)
name = 'Func-%s-%d' % (getattr(func, '__name__', str(func)), FunctionInterval.functionIntervalNum)
FunctionInterval.functionIntervalNum += 1
if suffix:
name = '%s-%s' % (name, str(suffix))