From 14dd52d56c6ea4d1afb4a7d9cdca1afdb2afa89a Mon Sep 17 00:00:00 2001 From: David Wells Date: Thu, 9 Jul 2015 20:53:26 -0400 Subject: [PATCH] Remove a deprecated function usage. This function (string.find) was deprecated in python 2.4 in favor of the .find() method of strings and was and removed in python 3. --- contrib/utilities/wrapcomments.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/contrib/utilities/wrapcomments.py b/contrib/utilities/wrapcomments.py index 3c18d38a22..30a870e511 100755 --- a/contrib/utilities/wrapcomments.py +++ b/contrib/utilities/wrapcomments.py @@ -9,7 +9,6 @@ from __future__ import print_function import textwrap import sys -import string wrapper = textwrap.TextWrapper() # take an array of lines and wrap them to 78 columns and let each line start @@ -73,19 +72,19 @@ def format_block(lines, infostr=""): if lines[0].strip()!="/**": #print ("%s warning code block not starting in separate line"%infostr, file=sys.stderr) - idx = string.find(lines[0],"/**") + idx = lines[0].find("/**") temp = [lines[0][0:idx+3], lines[0][idx+3:]] temp.extend(lines[1:]) lines = temp if lines[-1].strip()!="*/": #print ("%s warning code block not ending in separate line"%infostr, file=sys.stderr) - idx = string.find(lines[-1],"*/") + idx = lines[-1].find("*/") temp = lines[0:-1] temp.append(lines[-1][0:idx]) temp.append(lines[-1][idx:]) lines = temp - idx = string.find(lines[0],"/**") + idx = lines[0].find("/**") start = lines[0][:idx]+" * " out = [lines[0].rstrip()] -- 2.39.5