aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2019-06-20 11:40:35 -0400
committerEduardo Habkost <ehabkost@redhat.com>2019-07-01 19:02:10 -0300
commit08aa87f5e78270c3b225eb5c89c069aa9f49f5c1 (patch)
treed9eb04b1c8481661795e30ccecc0de038ba81203
parent7d0e02405fc02a181319b1ab8681d2f72246b7c6 (diff)
downloadqemu-08aa87f5e78270c3b225eb5c89c069aa9f49f5c1.zip
qemu-08aa87f5e78270c3b225eb5c89c069aa9f49f5c1.tar.gz
qemu-08aa87f5e78270c3b225eb5c89c069aa9f49f5c1.tar.bz2
qmp: make qmp-shell work with python3
python3 doesn't have raw_input(), so qmp-shell breaks. Use input() instead and override it with raw_input() if running on python2. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20190620154035.30989-1-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rwxr-xr-xscripts/qmp/qmp-shell5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell
index 7776c7b..f1cddea 100755
--- a/scripts/qmp/qmp-shell
+++ b/scripts/qmp/qmp-shell
@@ -78,6 +78,9 @@ import re
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
from qemu import qmp
+if sys.version_info[0] == 2:
+ input = raw_input
+
class QMPCompleter(list):
def complete(self, text, state):
for cmd in self:
@@ -308,7 +311,7 @@ class QMPShell(qmp.QEMUMonitorProtocol):
@return True if execution was ok, return False if disconnected.
"""
try:
- cmdline = raw_input(prompt)
+ cmdline = input(prompt)
except EOFError:
print()
return False