diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-04-24 01:09:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-24 01:09:46 (GMT) |
commit | 5054459678db1f9737e31b96a859112dbac98c52 (patch) | |
tree | 68abcce9e4295ab2c6c42342345406d0bd3c6006 /Lib/idlelib/editor.py | |
parent | 7b2ac6cf3dd33d591d0e14a020c84aa331d29932 (diff) | |
download | cpython-5054459678db1f9737e31b96a859112dbac98c52.zip cpython-5054459678db1f9737e31b96a859112dbac98c52.tar.gz cpython-5054459678db1f9737e31b96a859112dbac98c52.tar.bz2 |
[3.11] gh-103668: Run pyugrade on idlelib (GH-103671) (#103730)
---------
(cherry picked from commit bd2dca035af88694e25fb060f984fbbcda82bed8)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Terry Jan Reedy tjreedy@udel.edu
Diffstat (limited to 'Lib/idlelib/editor.py')
-rw-r--r-- | Lib/idlelib/editor.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index 08d6aa2..5058155 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -38,12 +38,13 @@ darwin = sys.platform == 'darwin' def _sphinx_version(): "Format sys.version_info to produce the Sphinx version string used to install the chm docs" major, minor, micro, level, serial = sys.version_info - release = '%s%s' % (major, minor) - release += '%s' % (micro,) + # TODO remove unneeded function since .chm no longer installed + release = f'{major}{minor}' + release += f'{micro}' if level == 'candidate': - release += 'rc%s' % (serial,) + release += f'rc{serial}' elif level != 'final': - release += '%s%s' % (level[0], serial) + release += f'{level[0]}{serial}' return release @@ -950,7 +951,7 @@ class EditorWindow: rf_list = [] file_path = self.recent_files_path if file_path and os.path.exists(file_path): - with open(file_path, 'r', + with open(file_path, encoding='utf_8', errors='replace') as rf_list_file: rf_list = rf_list_file.readlines() if new_file: @@ -1458,7 +1459,7 @@ class EditorWindow: else: self.reindent_to(y.compute_backslash_indent()) else: - assert 0, "bogus continuation type %r" % (c,) + assert 0, f"bogus continuation type {c!r}" return "break" # This line starts a brand new statement; indent relative to |