[PATCH] D131789: [clang-tools-extra] Rewrite prints in python3 compatible way

Danil Sidoruk via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 12 09:41:34 PDT 2022


eoanermine created this revision.
eoanermine added reviewers: klimek, HazardyKnusperkeks.
eoanermine added a project: clang-tools-extra.
Herald added a project: All.
eoanermine requested review of this revision.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131789

Files:
  clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py


Index: clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
===================================================================
--- clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
+++ clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
@@ -39,7 +39,7 @@
   result = './'
   while not os.path.isfile(os.path.join(result, path)):
     if os.path.realpath(result) == '/':
-      print 'Error: could not find compilation database.'
+      print('Error: could not find compilation database.')
       sys.exit(1)
     result += '../'
   return os.path.realpath(result)
@@ -49,7 +49,7 @@
   """Merge all symbol files (yaml) in a given directory into a single file."""
   invocation = [args.binary, '-merge-dir='+directory, args.saving_path]
   subprocess.call(invocation)
-  print 'Merge is finished. Saving results in ' + args.saving_path
+  print('Merge is finished. Saving results in ' + args.saving_path)
 
 
 def run_find_all_symbols(args, tmpdir, build_path, queue):
@@ -118,7 +118,7 @@
   except KeyboardInterrupt:
     # This is a sad hack. Unfortunately subprocess goes
     # bonkers with ctrl-c and we start forking merrily.
-    print '\nCtrl-C detected, goodbye.'
+    print('\nCtrl-C detected, goodbye.')
     os.kill(0, 9)
 
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131789.452209.patch
Type: text/x-patch
Size: 1334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220812/29b8641f/attachment.bin>


More information about the cfe-commits mailing list