From 29b0f7a9cc94b01579ff6c1a4d0dfe10fe0ad1b0 Mon Sep 17 00:00:00 2001 From: chenyan Date: Sun, 2 Sep 2018 20:29:28 +0800 Subject: [PATCH] Fix raw_input issue for Python 2/3 compatible code. use six.moves instead of builtins (from future). Story: 2003429 Task: 24619 Change-Id: I05823db8b8c4c38ad99b608247d1f13dded350ea Signed-off-by: chenyan Signed-off-by: Sun Austin --- cgcs-patch/cgcs-patch/cgcs_patch/patch_client.py | 3 ++- 1 file changed, 2 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 c90b9cde..6f29e16e 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 __future__ import print_function +from six.moves 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