[Python-checkins] IDLE: replace if statement with expression (GH-94228)
miss-islington
webhook-mailer at python.org
Fri Jun 24 13:30:42 EDT 2022
https://github.com/python/cpython/commit/b140e5a4ac364360a444a760cbb17ab9c165c95f
commit: b140e5a4ac364360a444a760cbb17ab9c165c95f
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-06-24T10:30:32-07:00
summary:
IDLE: replace if statement with expression (GH-94228)
(cherry picked from commit 91f9947f231cce2c72a3fb7b5c8e8cf49cc2c10f)
Co-authored-by: Terry Jan Reedy <tjreedy at udel.edu>
files:
M Lib/idlelib/iomenu.py
diff --git a/Lib/idlelib/iomenu.py b/Lib/idlelib/iomenu.py
index 86ce68c06a447..327e885203c3c 100644
--- a/Lib/idlelib/iomenu.py
+++ b/Lib/idlelib/iomenu.py
@@ -13,14 +13,10 @@
from idlelib.util import py_extensions
py_extensions = ' '.join("*"+ext for ext in py_extensions)
-
encoding = 'utf-8'
-if sys.platform == 'win32':
- errors = 'surrogatepass'
-else:
- errors = 'surrogateescape'
+errors = 'surrogatepass' if sys.platform == 'win32' else 'surrogateescape'
+
-
class IOBinding:
# One instance per editor Window so methods know which to save, close.
# Open returns focus to self.editwin if aborted.
More information about the Python-checkins
mailing list