From 2d1e3b7981ff7b4ff8619a71d6dd569526d99c0e Mon Sep 17 00:00:00 2001 From: chenyan Date: Thu, 30 Aug 2018 14:53:24 +0800 Subject: [PATCH] Fix raw_input issue for Python 2/3 compatible code. Story: 2003429 Task: 24619 Change-Id: I8a93c07886d27a5c0835ac38ccf3e6c8b0f80497 Signed-off-by: chenyan --- cgcs-patch/cgcs-patch/cgcs_patch/patch_client.py | 3 ++- tox.ini | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cgcs-patch/cgcs-patch/cgcs_patch/patch_client.py b/cgcs-patch/cgcs-patch/cgcs_patch/patch_client.py index d4cdba44..940304e5 100644 --- a/cgcs-patch/cgcs-patch/cgcs_patch/patch_client.py +++ b/cgcs-patch/cgcs-patch/cgcs_patch/patch_client.py @@ -5,6 +5,7 @@ SPDX-License-Identifier: Apache-2.0 """ +from builtins import input import requests import json import os @@ -600,7 +601,7 @@ def patch_commit_req(debug, args): print textwrap.fill(commit_warning, width=TERM_WIDTH, subsequent_indent=' ' * 9) print - user_input = raw_input("Would you like to continue? [y/N]: ") + user_input = input("Would you like to continue? [y/N]: ") if user_input.lower() != 'y': print "Aborting..." return 1 diff --git a/tox.ini b/tox.ini index 0188d675..50076a37 100644 --- a/tox.ini +++ b/tox.ini @@ -100,6 +100,7 @@ deps = {[testenv]deps} requests requests_toolbelt rpm + future basepython = python2.7 commands = pylint {[testenv]cgcs_patch_src_dir} \ {[testenv]patch_alarm_src_dir} \