diff options
author | Rene Ladan <rene@FreeBSD.org> | 2020-07-11 20:26:01 +0000 |
---|---|---|
committer | Rene Ladan <rene@FreeBSD.org> | 2020-07-11 20:26:01 +0000 |
commit | ec55b02c40b13218bb7a52999a0d48de534bfaf2 (patch) | |
tree | 4567b0ebfeb2fdda1853be17e9cec0da88c39196 /Tools | |
parent | 837a0c94356a96b44dfe009959f2ef5625603167 (diff) | |
download | freebsd-ports-ec55b02c40b13218bb7a52999a0d48de534bfaf2.zip |
Tools/scripts/patchtool: adjust for Python 3
PR: 246414
Submitted by: ashish
Event: July 2020 Bugathon
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/patchtool.py | 7 |
1 files changed, 6 insertions, 1 deletions
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 |