[Python-checkins] [3.11] gh-88878: IDLE - replace type('') with str (GH-95792)

miss-islington webhook-mailer at python.org
Tue Aug 9 14:10:16 EDT 2022


https://github.com/python/cpython/commit/a9c25cdd0dccdd617f1fd3edcb2b89db6f283e25
commit: a9c25cdd0dccdd617f1fd3edcb2b89db6f283e25
branch: 3.10
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-08-09T11:10:00-07:00
summary:

[3.11] gh-88878: IDLE - replace type('') with str (GH-95792)


Change in idlelib.browser, line 54
cherrypicked from 3680ebed7f3e529d01996dd0318601f9f0d02b4b
(cherry picked from commit 1a22ec5d69c2cbe51afdaff2cc3bc25a9514dd4f)

Co-authored-by: Terry Jan Reedy <tjreedy at udel.edu>

files:
M Lib/idlelib/browser.py

diff --git a/Lib/idlelib/browser.py b/Lib/idlelib/browser.py
index 10d9a7261113..4fe64dced60a 100644
--- a/Lib/idlelib/browser.py
+++ b/Lib/idlelib/browser.py
@@ -52,7 +52,7 @@ def transform_children(child_dict, modname=None):
                 # If obj.name != key, it has already been suffixed.
                 supers = []
                 for sup in obj.super:
-                    if type(sup) is type(''):
+                    if isinstance(sup, str):
                         sname = sup
                     else:
                         sname = sup.name



More information about the Python-checkins mailing list