[NFC] convert compiler-rt/lib/dfsan/scripts/build-libc-list.py to python3 syntax
authorTobias Hieta <tobias@hieta.se>
Fri, 10 Feb 2023 07:33:32 +0000 (08:33 +0100)
committerTobias Hieta <tobias@hieta.se>
Fri, 10 Feb 2023 09:20:51 +0000 (10:20 +0100)
I found a few Python files not using Python 3 syntax in the tree
when trying to apply reformatting to them. This was converted with
2to3 and the changes seemed sane.

Reviewed By: MaskRay, browneee

Differential Revision: https://reviews.llvm.org/D143701

compiler-rt/lib/dfsan/scripts/build-libc-list.py

index 5247496..5452252 100755 (executable)
@@ -69,7 +69,7 @@ p.add_option('--error-missing-lib', action='store_true',
 
 libs = options.lib_file
 if not libs:
-    print >> sys.stderr, 'No libraries provided.'
+    print('No libraries provided.', file=sys.stderr)
     exit(1)
 
 missing_lib = False
@@ -79,14 +79,14 @@ for l in libs:
     functions += defined_function_list(l)
   else:
     missing_lib = True
-    print >> sys.stderr, 'warning: library %s not found' % l
+    print('warning: library %s not found' % l, file=sys.stderr)
 
 if options.error_missing_lib and missing_lib:
-    print >> sys.stderr, 'Exiting with failure code due to missing library.'
+    print('Exiting with failure code due to missing library.', file=sys.stderr)
     exit(1)
 
 functions = list(set(functions))
 functions.sort()
 
 for f in functions:
-  print 'fun:%s=uninstrumented' % f
+  print('fun:%s=uninstrumented' % f)