summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/unusedvarsglobal.py
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/unusedvarsglobal.py')
-rwxr-xr-xcompilerplugins/clang/unusedvarsglobal.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/compilerplugins/clang/unusedvarsglobal.py b/compilerplugins/clang/unusedvarsglobal.py
index db46b9fee1ca..ccb7305ccc23 100755
--- a/compilerplugins/clang/unusedvarsglobal.py
+++ b/compilerplugins/clang/unusedvarsglobal.py
@@ -1,6 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/python3
-import sys
import re
import io
@@ -12,7 +11,7 @@ defToTypeMap = dict()
def parseFieldInfo( tokens ):
return (tokens[1].strip(), tokens[2].strip())
-with io.open("workdir/loplugin.unusedvarsglobal.log", "rb", buffering=1024*1024) as txt:
+with io.open("workdir/loplugin.unusedvarsglobal.log", "r", buffering=16*1024*1024) as txt:
for line in txt:
try:
tokens = line.strip().split("\t")
@@ -46,7 +45,7 @@ with io.open("workdir/loplugin.unusedvarsglobal.log", "rb", buffering=1024*1024)
else:
print( "unknown line: " + line)
except IndexError:
- print "problem with line " + line.strip()
+ print("problem with line " + line.strip())
raise
definitionSet2 = set()
@@ -127,7 +126,7 @@ def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
# sort by both the source-line and the datatype, so the output file ordering is stable
# when we have multiple items on the same source line
def v_sort_key(v):
- return natural_sort_key(v[0]) + [v1]]
+ return natural_sort_key(v[0]) + [v[1]]
# sort results by name and line number
tmp1list = sorted(untouchedSet, key=lambda v: v_sort_key(v))