mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 17:35:34 -04:00
PythonUtil: Fix usage of reduce() for Python 3
This commit is contained in:
parent
abe761c30e
commit
13011278af
@ -39,6 +39,7 @@ import random
|
|||||||
import time
|
import time
|
||||||
import builtins
|
import builtins
|
||||||
import importlib
|
import importlib
|
||||||
|
import functools
|
||||||
|
|
||||||
__report_indent = 3
|
__report_indent = 3
|
||||||
|
|
||||||
@ -2062,7 +2063,7 @@ def report(types = [], prefix = '', xform = None, notifyFunc = None, dConfigPara
|
|||||||
if not rArgs:
|
if not rArgs:
|
||||||
rArgs = '()'
|
rArgs = '()'
|
||||||
else:
|
else:
|
||||||
rArgs = '(' + reduce(str.__add__,rArgs)[:-2] + ')'
|
rArgs = '(' + functools.reduce(str.__add__,rArgs)[:-2] + ')'
|
||||||
|
|
||||||
|
|
||||||
outStr = '%s%s' % (f.__name__, rArgs)
|
outStr = '%s%s' % (f.__name__, rArgs)
|
||||||
@ -2345,7 +2346,7 @@ class MiniLog:
|
|||||||
if not rArgs:
|
if not rArgs:
|
||||||
rArgs = '()'
|
rArgs = '()'
|
||||||
else:
|
else:
|
||||||
rArgs = '(' + reduce(str.__add__,rArgs)[:-2] + ')'
|
rArgs = '(' + functools.reduce(str.__add__,rArgs)[:-2] + ')'
|
||||||
|
|
||||||
line = '%s%s' % (funcName, rArgs)
|
line = '%s%s' % (funcName, rArgs)
|
||||||
self.appendFunctionCall(line)
|
self.appendFunctionCall(line)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user