summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgiovanniwijaya <16949408+giovanniwijaya@users.noreply.github.com>2021-09-10 21:10:28 (GMT)
committerGitHub <noreply@github.com>2021-09-10 21:10:28 (GMT)
commitb74c819fab86bedc9b962ea42cfb9b5893fd2dda (patch)
tree04ec43d0a27e9975ea2832fe712e43e940c69181
parentf8d624d6a571d6e773f53ad80aa93face7e8395b (diff)
downloadcpython-b74c819fab86bedc9b962ea42cfb9b5893fd2dda.zip
cpython-b74c819fab86bedc9b962ea42cfb9b5893fd2dda.tar.gz
cpython-b74c819fab86bedc9b962ea42cfb9b5893fd2dda.tar.bz2
IDLE: adjust Python version in doc url for 3.10+ (GH-28228)
Expression 'python_version()[:3]' truncated '3.10.0' to '3.1' instead of '3.10'. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
-rw-r--r--Lib/idlelib/help_about.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/idlelib/help_about.py b/Lib/idlelib/help_about.py
index 64b13ac..019aacb 100644
--- a/Lib/idlelib/help_about.py
+++ b/Lib/idlelib/help_about.py
@@ -10,6 +10,8 @@ from tkinter import SUNKEN, TOP, BOTTOM, LEFT, X, BOTH, W, EW, NSEW, E
from idlelib import textview
+version = python_version()
+
def build_bits():
"Return bits for platform."
@@ -42,7 +44,7 @@ class AboutDialog(Toplevel):
self.create_widgets()
self.resizable(height=False, width=False)
self.title(title or
- f'About IDLE {python_version()} ({build_bits()} bit)')
+ f'About IDLE {version} ({build_bits()} bit)')
self.transient(parent)
self.grab_set()
self.protocol("WM_DELETE_WINDOW", self.ok)
@@ -88,8 +90,8 @@ class AboutDialog(Toplevel):
email = Label(frame_background, text='email: idle-dev@python.org',
justify=LEFT, fg=self.fg, bg=self.bg)
email.grid(row=6, column=0, columnspan=2, sticky=W, padx=10, pady=0)
- docs = Label(frame_background, text='https://docs.python.org/' +
- python_version()[:3] + '/library/idle.html',
+ docs = Label(frame_background, text="https://docs.python.org/"
+ f"{version[:version.rindex('.')]}/library/idle.html",
justify=LEFT, fg=self.fg, bg=self.bg)
docs.grid(row=7, column=0, columnspan=2, sticky=W, padx=10, pady=0)
@@ -98,7 +100,7 @@ class AboutDialog(Toplevel):
columnspan=3, padx=5, pady=5)
pyver = Label(frame_background,
- text='Python version: ' + python_version(),
+ text='Python version: ' + version,
fg=self.fg, bg=self.bg)
pyver.grid(row=9, column=0, sticky=W, padx=10, pady=0)
tkver = Label(frame_background, text='Tk version: ' + tk_patchlevel,
@@ -124,7 +126,7 @@ class AboutDialog(Toplevel):
columnspan=3, padx=5, pady=5)
idlever = Label(frame_background,
- text='IDLE version: ' + python_version(),
+ text='IDLE version: ' + version,
fg=self.fg, bg=self.bg)
idlever.grid(row=12, column=0, sticky=W, padx=10, pady=0)
idle_buttons = Frame(frame_background, bg=self.bg)