[PATCH] D67818: [LNT] Python 3 support: adapt to renaming of raw_input to input

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 01:42:27 PDT 2019


thopre created this revision.
thopre added reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls.
thopre added a parent revision: D67817: [LNT] Python 3 support: adapt to map returning a view.
thopre added a child revision: D67819: [LNT] Python 3 support: adapt to zip returning a view.

Replace calls to raw_input by calls to input() which is not evaluated as
an expression in Python3. This was produced by running futurize's stage2
lib2to3.fixes.fix_raw_input.


https://reviews.llvm.org/D67818

Files:
  lnt/external/stats/stats.py


Index: lnt/external/stats/stats.py
===================================================================
--- lnt/external/stats/stats.py
+++ lnt/external/stats/stats.py
@@ -775,7 +775,7 @@
     samples = ''
     while samples not in ['i','r','I','R','c','C']:
         print('\nIndependent or related samples, or correlation (i,r,c): ', end=' ')
-        samples = raw_input()
+        samples = input()
 
     if samples in ['i','I','r','R']:
         print('\nComparing variances ...', end=' ')
@@ -810,7 +810,7 @@
         corrtype = ''
         while corrtype not in ['c','C','r','R','d','D']:
             print('\nIs the data Continuous, Ranked, or Dichotomous (c,r,d): ', end=' ')
-            corrtype = raw_input()
+            corrtype = input()
         if corrtype in ['c','C']:
             m,b,r,p,see = linregress(x,y)
             print('\nLinear regression for continuous variables ...')
@@ -2996,7 +2996,7 @@
     samples = ''
     while samples not in ['i','r','I','R','c','C']:
         print('\nIndependent or related samples, or correlation (i,r,c): ', end=' ')
-        samples = raw_input()
+        samples = input()
 
     if samples in ['i','I','r','R']:
         print('\nComparing variances ...', end=' ')
@@ -3031,7 +3031,7 @@
         corrtype = ''
         while corrtype not in ['c','C','r','R','d','D']:
             print('\nIs the data Continuous, Ranked, or Dichotomous (c,r,d): ', end=' ')
-            corrtype = raw_input()
+            corrtype = input()
         if corrtype in ['c','C']:
             m,b,r,p,see = linregress(x,y)
             print('\nLinear regression for continuous variables ...')


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67818.220976.patch
Type: text/x-patch
Size: 1643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190920/ce087153/attachment.bin>


More information about the llvm-commits mailing list