[PATCH] D68138: [utils] Fix incompatibility of bisect[-skip-count] with Python 3

Mikhail Maltsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 09:44:06 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL373759: [utils] Fix incompatibility of bisect[-skip-count] with Python 3 (authored by miyuki, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D68138?vs=222617&id=223239#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68138/new/

https://reviews.llvm.org/D68138

Files:
  llvm/trunk/utils/bisect
  llvm/trunk/utils/bisect-skip-count


Index: llvm/trunk/utils/bisect
===================================================================
--- llvm/trunk/utils/bisect
+++ llvm/trunk/utils/bisect
@@ -12,6 +12,7 @@
 # And bisect will continually call ./script.sh with various counts using
 # the exit status to determine success and failure.
 #
+from __future__ import print_function
 import os
 import sys
 import argparse
@@ -34,10 +35,10 @@
 
 last = None
 while start != end and start != end-1:
-    count = start + (end - start)/2
+    count = start + (end - start)//2
     print("Visiting Count: %d with (Start, End) = (%d,%d)" % (count, start, end))
     cmd = [x % {'count':count} for x in args.command]
-    print cmd
+    print(cmd)
     result = subprocess.call(cmd)
     if result == 0:
         print("    PASSES! Setting start to count")
Index: llvm/trunk/utils/bisect-skip-count
===================================================================
--- llvm/trunk/utils/bisect-skip-count
+++ llvm/trunk/utils/bisect-skip-count
@@ -20,6 +20,7 @@
 # result.  Incrementing the last good count by one or decrementing the
 # last good skip by one should produce a failure.
 #
+from __future__ import print_function
 import os
 import sys
 import argparse
@@ -52,10 +53,10 @@
 
 last = None
 while start != end and start != end-1:
-    count = start + (end - start)/2
+    count = start + (end - start)//2
     print("Visiting Skip: %d with (Start, End) = (%d,%d)" % (count, start, end))
     cmd = [x % {'skip':count, 'count':-1} for x in args.command]
-    print cmd
+    print(cmd)
     try:
         result = subprocess.call(cmd, shell=args.shell, timeout=args.timeout)
         if result == 0:
@@ -75,10 +76,10 @@
 print("Start: %d" % start)
 print("End: %d" % end)
 while start != end and start != end-1:
-    count = start + (end - start)/2
+    count = start + (end - start)//2
     print("Visiting Count: %d with (Start, End) = (%d,%d)" % (count, start, end))
     cmd = [x % {'count':count, 'skip':firstcount } for x in args.command]
-    print cmd
+    print(cmd)
     try:
         result = subprocess.call(cmd, shell=args.shell, timeout=args.timeout)
         if result == 0:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68138.223239.patch
Type: text/x-patch
Size: 2154 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191004/531c73dd/attachment-0001.bin>


More information about the llvm-commits mailing list