34
34
import sys
35
35
import textwrap
36
36
37
+ from six .moves import input
38
+
37
39
PANDAS_HOME = '.'
38
40
PROJECT_NAME = 'pandas'
39
41
print ("PANDAS_HOME = " + PANDAS_HOME )
@@ -96,11 +98,11 @@ def run_cmd(cmd):
96
98
if cmd is None :
97
99
cmd = popenargs [0 ]
98
100
raise subprocess .CalledProcessError (retcode , cmd , output = output )
99
- return output
101
+ return six . text_type ( output )
100
102
101
103
102
104
def continue_maybe (prompt ):
103
- result = raw_input ("\n %s (y/n): " % prompt )
105
+ result = input ("\n %s (y/n): " % prompt )
104
106
if result .lower () != "y" :
105
107
fail ("Okay, exiting" )
106
108
@@ -114,7 +116,7 @@ def clean_up():
114
116
115
117
branches = run_cmd ("git branch" ).replace (" " , "" ).split ("\n " )
116
118
117
- for branch in filter ( lambda x : x .startswith (BRANCH_PREFIX ), branches ) :
119
+ for branch in [ b for b in branches if x .startswith (BRANCH_PREFIX )] :
118
120
print ("Deleting local branch %s" % branch )
119
121
run_cmd ("git branch -D %s" % branch )
120
122
@@ -199,7 +201,7 @@ def merge_pr(pr_num, target_ref):
199
201
200
202
201
203
def cherry_pick (pr_num , merge_hash , default_branch ):
202
- pick_ref = raw_input ("Enter a branch name [%s]: " % default_branch )
204
+ pick_ref = input ("Enter a branch name [%s]: " % default_branch )
203
205
if pick_ref == "" :
204
206
pick_ref = default_branch
205
207
@@ -245,7 +247,7 @@ def fix_version_from_branch(branch, versions):
245
247
# Assumes branch names can be sorted lexicographically
246
248
# latest_branch = sorted(branch_names, reverse=True)[0]
247
249
248
- pr_num = raw_input ("Which pull request would you like to merge? (e.g. 34): " )
250
+ pr_num = input ("Which pull request would you like to merge? (e.g. 34): " )
249
251
pr = get_json ("%s/pulls/%s" % (GITHUB_API_BASE , pr_num ))
250
252
251
253
url = pr ["url" ]
0 commit comments