From f8b47dc14c27b0189a9d8395efb09e7be0f846e3 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 18 Oct 2018 22:19:55 +0200 Subject: [PATCH] direct: fix slowness in big games with Func(messenger.send) --- direct/src/interval/FunctionInterval.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/direct/src/interval/FunctionInterval.py b/direct/src/interval/FunctionInterval.py index 8f84ca9df8..db626c404e 100644 --- a/direct/src/interval/FunctionInterval.py +++ b/direct/src/interval/FunctionInterval.py @@ -77,7 +77,10 @@ class FunctionInterval(Interval.Interval): @staticmethod def makeUniqueName(func, suffix = ''): - name = 'Func-%s-%d' % (getattr(func, '__name__', str(func)), FunctionInterval.functionIntervalNum) + func_name = getattr(func, '__name__', None) + if func_name is None: + func_name = str(func) + name = 'Func-%s-%d' % (func_name, FunctionInterval.functionIntervalNum) FunctionInterval.functionIntervalNum += 1 if suffix: name = '%s-%s' % (name, str(suffix))