From 13011278afc4dea94c3ae1f825bf965fbf3bdcfd Mon Sep 17 00:00:00 2001 From: pythonengineer Date: Sat, 1 Aug 2020 21:44:31 -0400 Subject: [PATCH] PythonUtil: Fix usage of reduce() for Python 3 --- direct/src/showbase/PythonUtil.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 8605a3f891..3c5142a717 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -39,6 +39,7 @@ import random import time import builtins import importlib +import functools __report_indent = 3 @@ -2062,7 +2063,7 @@ def report(types = [], prefix = '', xform = None, notifyFunc = None, dConfigPara if not rArgs: rArgs = '()' else: - rArgs = '(' + reduce(str.__add__,rArgs)[:-2] + ')' + rArgs = '(' + functools.reduce(str.__add__,rArgs)[:-2] + ')' outStr = '%s%s' % (f.__name__, rArgs) @@ -2345,7 +2346,7 @@ class MiniLog: if not rArgs: rArgs = '()' else: - rArgs = '(' + reduce(str.__add__,rArgs)[:-2] + ')' + rArgs = '(' + functools.reduce(str.__add__,rArgs)[:-2] + ')' line = '%s%s' % (funcName, rArgs) self.appendFunctionCall(line)