Index: lnt/external/stats/pstat.py =================================================================== --- lnt/external/stats/pstat.py +++ lnt/external/stats/pstat.py @@ -215,16 +215,16 @@ column = 0 if isinstance(cnums, (list, tuple)): # if multiple columns to get index = cnums[0] - column = map(lambda x: x[index], listoflists) + column = [x[index] for x in listoflists] for col in cnums[1:]: index = col - column = abut(column,map(lambda x: x[index], listoflists)) + column = abut(column, [x[index] for x in listoflists]) elif isinstance(cnums, str): # if an 'x[3:]' type expr. evalstring = 'map(lambda x: x'+cnums+', listoflists)' column = eval(evalstring) else: # else it's just 1 col to get index = cnums - column = map(lambda x: x[index], listoflists) + column = [x[index] for x in listoflists] return column @@ -462,7 +462,7 @@ Usage: list2string (inlist,delimit=' ') Returns: the string created from inlist """ - stringlist = map(makestr,inlist) + stringlist = list(map(makestr, inlist)) return string.join(stringlist,delimit) @@ -509,8 +509,8 @@ maxsize = [0]*len(list2print[0]) for col in range(len(list2print[0])): items = colex(list2print,col) - items = map(makestr,items) - maxsize[col] = max(map(len,items)) + extra + items = list(map(makestr, items)) + maxsize[col] = max(list(map(len, items))) + extra for row in lst: if row == ['\n'] or row == '\n' or row == '' or row == ['']: print() @@ -962,7 +962,7 @@ """ return if row1.dtype.char=='O' or row2.dtype=='O': - cmpvect = N.logical_not(abs(N.array(map(cmp,row1,row2)))) # cmp fcn gives -1,0,1 + cmpvect = N.logical_not(abs(N.array(list(map(cmp, row1, row2))))) # cmp fcn gives -1,0,1 else: cmpvect = N.equal(row1,row2) return cmpvect @@ -1022,7 +1022,7 @@ for item in inarray[1:]: newflag = 1 for unq in uniques: # NOTE: cmp --> 0=same, -1=<, 1=> - test = N.sum(abs(N.array(map(cmp,item,unq)))) + test = N.sum(abs(N.array(list(map(cmp, item, unq))))) if test == 0: # if item identical to any 1 row in uniques newflag = 0 # then not a novel item to add break Index: lnt/external/stats/stats.py =================================================================== --- lnt/external/stats/stats.py +++ lnt/external/stats/stats.py @@ -841,8 +841,8 @@ if len(x) != len(y): raise ValueError('Input values not paired in pearsonr. Aborting.') n = len(x) - x = map(float,x) - y = map(float,y) + x = list(map(float, x)) + y = list(map(float, y)) xmean = mean(x) ymean = mean(y) r_num = n*(summult(x,y)) - sum(x)*sum(y) @@ -970,8 +970,8 @@ if len(x) != len(y): raise ValueError('Input values not paired in linregress. Aborting.') n = len(x) - x = map(float,x) - y = map(float,y) + x = list(map(float, x)) + y = list(map(float, y)) xmean = mean(x) ymean = mean(y) r_num = float(n*(summult(x,y)) - sum(x)*sum(y)) @@ -1234,7 +1234,7 @@ if diff != 0: d.append(diff) count = len(d) - absd = map(abs,d) + absd = list(map(abs, d)) absranked = rankdata(absd) r_plus = 0.0 r_minus = 0.0 @@ -1264,7 +1264,7 @@ args = list(args) n = [0]*len(args) all = [] - n = map(len,args) + n = list(map(len, args)) for i in range(len(args)): all = all + args[i] ranked = rankdata(all) @@ -1565,10 +1565,10 @@ vars = [0]*a ns = [0]*a alldata = [] - tmp = map(N.array,lists) - means = map(amean,tmp) - vars = map(avar,tmp) - ns = map(len,lists) + tmp = list(map(N.array, lists)) + means = list(map(amean, tmp)) + vars = list(map(avar, tmp)) + ns = list(map(len, lists)) for i in range(len(lists)): alldata = alldata + lists[i] alldata = N.array(alldata) @@ -1628,8 +1628,8 @@ maxsize = [0]*len(list2print[0]) for col in range(len(list2print[0])): items = pstat.colex(list2print,col) - items = map(pstat.makestr,items) - maxsize[col] = max(map(len,items)) + extra + items = list(map(pstat.makestr, items)) + maxsize[col] = max(list(map(len, items))) + extra for row in listoflists: if row == ['\n'] or row == '\n': outfile.write('\n') @@ -3641,7 +3641,7 @@ assert len(args) == 3, "Need at least 3 groups in stats.akruskalwallish()" args = list(args) n = [0]*len(args) - n = map(len,args) + n = list(map(len, args)) all = [] for i in range(len(args)): all = all + args[i].tolist() @@ -4050,10 +4050,10 @@ vars = [0]*na ns = [0]*na alldata = [] - tmp = map(N.array,args) - means = map(amean,tmp) - vars = map(avar,tmp) - ns = map(len,args) + tmp = list(map(N.array, args)) + means = list(map(amean, tmp)) + vars = list(map(avar, tmp)) + ns = list(map(len, args)) alldata = N.concatenate(args) bign = len(alldata) sstot = ass(alldata)-(asquare_of_sums(alldata)/float(bign)) Index: lnt/lnttool/main.py =================================================================== --- lnt/lnttool/main.py +++ lnt/lnttool/main.py @@ -170,7 +170,7 @@ print('Available tests:') test_names = lnt.tests.get_names() - max_name = max(map(len, test_names)) + max_name = max(list(map(len, test_names))) for name in test_names: test_module = lnt.tests.get_module(name) description = inspect.cleandoc(test_module.__doc__) Index: lnt/server/db/migrate.py =================================================================== --- lnt/server/db/migrate.py +++ lnt/server/db/migrate.py @@ -80,7 +80,7 @@ continue # Check the version numbers for validity. - version, next_version = map(int, m.groups()) + version, next_version = list(map(int, m.groups())) if next_version != version + 1: logger.error( "invalid script name %r in schema migration directory: %r", Index: lnt/server/ui/views.py =================================================================== --- lnt/server/ui/views.py +++ lnt/server/ui/views.py @@ -1330,7 +1330,7 @@ def get_machine_keys(m): m.css_name = m.name.replace('.', '-') return m - recent_machines = map(get_machine_keys, recent_machines) + recent_machines = list(map(get_machine_keys, recent_machines)) # For each machine, build a table of the machine, the baseline run, and the # most recent run. We also computed a list of all the runs we are reporting Index: lnt/testing/util/valgrind.py =================================================================== --- lnt/testing/util/valgrind.py +++ lnt/testing/util/valgrind.py @@ -74,7 +74,7 @@ # Check if this is the closing summary line. if ln.startswith('summary'): key, value = ln.split(':', 1) - summary_samples = map(int, value.split()) + summary_samples = list(map(int, value.split())) break # Check if this is an update to the current file or function. @@ -84,7 +84,7 @@ current_function = ln[3:-1] else: # Otherwise, this is a data record. - samples = map(int, ln.split()) + samples = list(map(int, ln.split())) if len(samples) != num_samples: raise CalltreeParseError( "invalid record line, unexpected sample count") Index: lnt/tests/nt.py =================================================================== --- lnt/tests/nt.py +++ lnt/tests/nt.py @@ -1304,7 +1304,7 @@ def _unix_quote_args(s): - return map(pipes.quote, shlex.split(s)) + return list(map(pipes.quote, shlex.split(s))) # When set to true, all benchmarks will be rerun.