svn commit: r542048 - head/Tools/scripts

Rene Ladan rene at FreeBSD.org
Sat Jul 11 20:26:02 UTC 2020


Author: rene
Date: Sat Jul 11 20:26:01 2020
New Revision: 542048
URL: https://svnweb.freebsd.org/changeset/ports/542048

Log:
  Tools/scripts/patchtool: adjust for Python 3
  
  PR:		246414
  Submitted by:	ashish
  Event:		July 2020 Bugathon

Modified:
  head/Tools/scripts/patchtool.py

Modified: head/Tools/scripts/patchtool.py
==============================================================================
--- head/Tools/scripts/patchtool.py	Sat Jul 11 20:23:00 2020	(r542047)
+++ head/Tools/scripts/patchtool.py	Sat Jul 11 20:26:01 2020	(r542048)
@@ -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


More information about the svn-ports-all mailing list