[PATCH] D67806: [LNT] Python 3 support: get rid of apply builtin function
Thomas Preud'homme via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 20 01:26:02 PDT 2019
thopre created this revision.
thopre added reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls.
Replace calls to deprecated python2-specific apply builtin by direct
function calls with explicit argument list unpacking. This was produced
by running futurize's stage1 lib2to3.fixes.fix_apply.
https://reviews.llvm.org/D67806
Files:
lnt/external/stats/stats.py
Index: lnt/external/stats/stats.py
===================================================================
--- lnt/external/stats/stats.py
+++ lnt/external/stats/stats.py
@@ -253,7 +253,7 @@
def __call__(self, arg1, *args, **kw):
if type(arg1) not in self._dispatch:
raise TypeError("don't know how to dispatch %s arguments" % type(arg1))
- return apply(self._dispatch[type(arg1)], (arg1,) + args, kw)
+ return self._dispatch[type(arg1)](*((arg1,) + args), **kw)
##########################################################################
@@ -1305,7 +1305,7 @@
if k < 3:
raise ValueError('Less than 3 levels. Friedman test not appropriate.')
n = len(args[0])
- data = apply(pstat.abut,tuple(args))
+ data = pstat.abut(*tuple(args))
for i in range(len(data)):
data[i] = rankdata(data[i])
ssbn = 0
@@ -3686,7 +3686,7 @@
if k < 3:
raise ValueError('\nLess than 3 levels. Friedman test not appropriate.\n')
n = len(args[0])
- data = apply(pstat.aabut,args)
+ data = pstat.aabut(*args)
data = data.astype(N.float_)
for i in range(len(data)):
data[i] = arankdata(data[i])
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67806.220963.patch
Type: text/x-patch
Size: 1197 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190920/f2b2b0ad/attachment.bin>
More information about the llvm-commits
mailing list