Skip to content

Commit 87fade3

Browse files
author
Thomas Preud'homme
committed
[LNT] Python 3 support: adapt to renaming of raw_input to input
Summary: Replace calls to raw_input by calls to input() which is not evaluated as an expression in Python3. Import input from builtins to maintain current behavior on Python2. This was produced by running futurize's stage2 lib2to3.fixes.fix_raw_input. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67818 llvm-svn: 372823
1 parent 6357568 commit 87fade3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lnt/external/stats/stats.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@
224224

225225
from __future__ import absolute_import
226226
from __future__ import print_function
227+
from builtins import input
227228
from . import pstat # required 3rd party module
228229
import math, string, copy # required python modules
229230
from types import *
@@ -776,7 +777,7 @@ def lpaired(x,y):
776777
samples = ''
777778
while samples not in ['i','r','I','R','c','C']:
778779
print('\nIndependent or related samples, or correlation (i,r,c): ', end=' ')
779-
samples = raw_input()
780+
samples = input()
780781

781782
if samples in ['i','I','r','R']:
782783
print('\nComparing variances ...', end=' ')
@@ -811,7 +812,7 @@ def lpaired(x,y):
811812
corrtype = ''
812813
while corrtype not in ['c','C','r','R','d','D']:
813814
print('\nIs the data Continuous, Ranked, or Dichotomous (c,r,d): ', end=' ')
814-
corrtype = raw_input()
815+
corrtype = input()
815816
if corrtype in ['c','C']:
816817
m,b,r,p,see = linregress(x,y)
817818
print('\nLinear regression for continuous variables ...')
@@ -2988,7 +2989,7 @@ def apaired(x,y):
29882989
samples = ''
29892990
while samples not in ['i','r','I','R','c','C']:
29902991
print('\nIndependent or related samples, or correlation (i,r,c): ', end=' ')
2991-
samples = raw_input()
2992+
samples = input()
29922993

29932994
if samples in ['i','I','r','R']:
29942995
print('\nComparing variances ...', end=' ')
@@ -3023,7 +3024,7 @@ def apaired(x,y):
30233024
corrtype = ''
30243025
while corrtype not in ['c','C','r','R','d','D']:
30253026
print('\nIs the data Continuous, Ranked, or Dichotomous (c,r,d): ', end=' ')
3026-
corrtype = raw_input()
3027+
corrtype = input()
30273028
if corrtype in ['c','C']:
30283029
m,b,r,p,see = linregress(x,y)
30293030
print('\nLinear regression for continuous variables ...')

requirements.client.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ typing
1717
click==6.7
1818
pyyaml==3.12
1919
requests
20+
future
2021
-e svn+https://llvm.org/svn/llvm-project/llvm/trunk/utils/lit/#egg=lit

0 commit comments

Comments
 (0)