summarylogtreecommitdiffstats
path: root/python3-ports.patch
blob: d6933911a7d01535e4297e17f859ccf17d9ccf75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/src/scripts/scale-frames.py b/src/scripts/scale-frames.py
index cadaeb1..f10c60b 100755
--- a/src/scripts/scale-frames.py
+++ b/src/scripts/scale-frames.py
@@ -17,8 +17,8 @@ SuffixNormalizedCSV = ".norm"
 
 ### Prints help
 def PrintUsage():
-  print "SYNTAX"
-  print "  " + sys.argv[0] + " [-s DIMENSION1,DIMENSION2...] TRACE1 TRACE2 ...\n"
+  print("SYNTAX")
+  print("  " + sys.argv[0] + " [-s DIMENSION1,DIMENSION2...] TRACE1 TRACE2 ...\n")
 
 if (len(sys.argv) < 2): # FIXME
   PrintUsage()
@@ -75,14 +75,14 @@ while ((currentArg < len(sys.argv)) and (sys.argv[currentArg][0] == '-')):
     DimensionsToScale = [dim for dim in DimensionsToScale]
   else:
     PrintUsage()
-    print "*** INVALID PARAMETER "+sys.argv[currentArg];
+    print("*** INVALID PARAMETER "+sys.argv[currentArg]);
     sys.exit(-1)
   currentArg = currentArg + 1
 
 ### 1 trace at least
 if (len(sys.argv) - currentArg < 1):
   PrintUsage()
-  print "*** Error: Pass 1 or more traces!"
+  print("*** Error: Pass 1 or more traces!")
   sys.exit(-1)
 
 InputTraces = []                      # array[ TRACE1, TRACE2 ... ]
@@ -112,7 +112,7 @@ for Trace in sys.argv[currentArg:]:
   CSVFile = TraceBasename + SuffixClustersData
 
   ### Get the number of tasks from the trace
-  Header = subprocess.Popen(["head", "-n1", Trace], shell=False, stdout=subprocess.PIPE).communicate()[0]
+  Header = subprocess.Popen(["head", "-n1", Trace], shell=False, stdout=subprocess.PIPE).communicate()[0].decode('utf-8')
   numTasks = float(Header.split("(")[2].split(":")[2])
   TasksPerTrace.append(numTasks)