Skip to content

Commit 63a1fcb

Browse files
tommyzlisershe-apache
authored andcommitted
HBASE-21712 : Make submit-patch.py python3 compatible
Signed-off-by: Sergey Shelukhin <[email protected]>
1 parent 7795af0 commit 63a1fcb

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.pylintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ dummy-variables-rgx=_|dummy
133133
# you should avoid to define new builtins when possible.
134134
additional-builtins=
135135

136+
# List of modules that can redefine builtins. (For python 2/3 compatibility)
137+
redefining-builtins-modules=builtins
138+
136139

137140
[TYPECHECK]
138141

dev-support/submit-patch.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# are not updated. Review board id is retrieved from the remote link in the jira.
2323
# Print help: submit-patch.py --h
2424
import argparse
25+
from builtins import input, str
2526
import getpass
2627
import git
2728
import json
@@ -146,7 +147,7 @@ def get_patch_name_with_version(patch_name_prefix):
146147
if html.status_code != 200:
147148
log_fatal_and_exit(" Cannot fetch jira information. Status code %s", html.status_code)
148149
# Iterate over patch names starting from version 1 and return when name is not already used.
149-
content = unicode(html.content, 'utf-8')
150+
content = str(html.content, 'utf-8')
150151
for i in range(1, 1000):
151152
name = patch_name_prefix + "." + ('{0:03d}'.format(i)) + ".patch"
152153
if name not in content:
@@ -196,10 +197,10 @@ def get_credentials():
196197
log_fatal_and_exit(" Couldn't decrypt ~/.apache-creds file. Exiting..")
197198
creds = json.loads(content)
198199
else:
199-
creds['jira_username'] = raw_input("Jira username:")
200+
creds['jira_username'] = input("Jira username:")
200201
creds['jira_password'] = getpass.getpass("Jira password:")
201202
if not args.skip_review_board:
202-
creds['rb_username'] = raw_input("Review Board username:")
203+
creds['rb_username'] = input("Review Board username:")
203204
creds['rb_password'] = getpass.getpass("Review Board password:")
204205
return creds
205206

0 commit comments

Comments
 (0)