From ec55b02c40b13218bb7a52999a0d48de534bfaf2 Mon Sep 17 00:00:00 2001 From: Rene Ladan Date: Sat, 11 Jul 2020 20:26:01 +0000 Subject: Tools/scripts/patchtool: adjust for Python 3 PR: 246414 Submitted by: ashish Event: July 2020 Bugathon --- Tools/scripts/patchtool.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Tools/scripts/patchtool.py') diff --git a/Tools/scripts/patchtool.py b/Tools/scripts/patchtool.py index c58d68e67dc2..201b64bfbb96 100755 --- a/Tools/scripts/patchtool.py +++ b/Tools/scripts/patchtool.py @@ -22,6 +22,11 @@ import os, os.path, subprocess, sys, getopt, glob, errno, types +# python3 lacks raw_input +compat_raw_input = input +if sys.version_info < (3,): + compat_raw_input = raw_input + # Some global variables used as constants #True = 1 #False = 0 @@ -264,7 +269,7 @@ def query_yn(message, default = False): else: yn = 'Y/N' - reply = raw_input('%s [%s]: ' % (message, yn)) + reply = compat_raw_input('%s [%s]: ' % (message, yn)) if reply == 'y' or reply == 'Y': return True -- cgit v1.2.3