]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Update old-style strings to f-strings (GH-30384)
authorDavid Gilbertson <gilbertson.david@gmail.com>
Tue, 4 Jan 2022 09:25:56 +0000 (20:25 +1100)
committerGitHub <noreply@github.com>
Tue, 4 Jan 2022 09:25:56 +0000 (01:25 -0800)
Let me know if this sort of change is unwanted...

Doc/includes/minidom-example.py

index 5ee7682c1927124fba3cfea51a21c02bd3b2e870..3b9e9ee2db291372bde27305114abb7e87ea93ca 100644 (file)
@@ -42,10 +42,10 @@ def handleSlide(slide):
     handlePoints(slide.getElementsByTagName("point"))
 
 def handleSlideshowTitle(title):
-    print("<title>%s</title>" % getText(title.childNodes))
+    print(f"<title>{getText(title.childNodes)}</title>")
 
 def handleSlideTitle(title):
-    print("<h2>%s</h2>" % getText(title.childNodes))
+    print(f"<h2>{getText(title.childNodes)}</h2>")
 
 def handlePoints(points):
     print("<ul>")
@@ -54,11 +54,11 @@ def handlePoints(points):
     print("</ul>")
 
 def handlePoint(point):
-    print("<li>%s</li>" % getText(point.childNodes))
+    print(f"<li>{getText(point.childNodes)}</li>")
 
 def handleToc(slides):
     for slide in slides:
         title = slide.getElementsByTagName("title")[0]
-        print("<p>%s</p>" % getText(title.childNodes))
+        print(f"<p>{getText(title.childNodes)}</p>")
 
 handleSlideshow(dom)