This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Typo: using "==" instead of "="
Type: behavior Stage: resolved
Components: IDLE, Tests Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: DiddiLeija, miss-islington, serhiy.storchaka, taleinat, terry.reedy
Priority: normal Keywords: patch

Created on 2021-08-31 11:41 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 28086 merged serhiy.storchaka, 2021-08-31 11:43
PR 28098 merged miss-islington, 2021-08-31 17:32
PR 28099 merged miss-islington, 2021-08-31 17:32
PR 28102 merged terry.reedy, 2021-08-31 17:50
PR 28104 merged miss-islington, 2021-08-31 18:59
PR 28105 merged miss-islington, 2021-08-31 19:01
Messages (8)
msg400713 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-08-31 11:41
While searching for use the equality operator with None I found the possible use of "==" instead of "=" (assignment) in Lib/idlelib/idle_test/test_macosx.py.

        for platform, types in ('darwin', alltypes), ('other', nontypes):
            with self.subTest(platform=platform):
                macosx.platform = platform
                macosx._tk_type == None
                macosx._init_tk_type()
                self.assertIn(macosx._tk_type, types)
msg400758 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-08-31 17:32
New changeset 54f100514b02f6628450043e21ccfe39350d7ac7 by Serhiy Storchaka in branch 'main':
bpo-45059: Fix IDLE test typo: using "==" instead of "=" (GH-28086)
https://github.com/python/cpython/commit/54f100514b02f6628450043e21ccfe39350d7ac7
msg400760 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-08-31 17:41
Definitely a typo.  Will apply fix and backport.

The first import of macosx initializes _tk_type to None.  The line in question intends to re-initialize it so that the subsequent assert can only pass if _init_tk_type changes it to something required.

Many other tests also set _tk_type as needed.  _tk_type should be restored in tearDownModule.  I will add that in a separate PR.  (The class cleanup already restores platform.)
msg400762 - (view) Author: miss-islington (miss-islington) Date: 2021-08-31 17:50
New changeset 337c8adf31c46b688a5f82bcb64dc6f1ad56703d by Miss Islington (bot) in branch '3.10':
bpo-45059: Fix IDLE test typo: using "==" instead of "=" (GH-28086)
https://github.com/python/cpython/commit/337c8adf31c46b688a5f82bcb64dc6f1ad56703d
msg400763 - (view) Author: miss-islington (miss-islington) Date: 2021-08-31 17:53
New changeset c1db7598790d037e58cd99c06d5c166433d63322 by Miss Islington (bot) in branch '3.9':
bpo-45059: Fix IDLE test typo: using "==" instead of "=" (GH-28086)
https://github.com/python/cpython/commit/c1db7598790d037e58cd99c06d5c166433d63322
msg400771 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-08-31 18:59
New changeset 22fe0eb13c3441b71b60aaea0e7fe289a29783da by Terry Jan Reedy in branch 'main':
bpo-45059: Add module cleanup to IDLE test_macosx (GH-28102)
https://github.com/python/cpython/commit/22fe0eb13c3441b71b60aaea0e7fe289a29783da
msg400772 - (view) Author: miss-islington (miss-islington) Date: 2021-08-31 19:21
New changeset 0f274cb2d78f71073e9d7295df3b9006e7bf1097 by Miss Islington (bot) in branch '3.10':
bpo-45059: Add module cleanup to IDLE test_macosx (GH-28102)
https://github.com/python/cpython/commit/0f274cb2d78f71073e9d7295df3b9006e7bf1097
msg400773 - (view) Author: miss-islington (miss-islington) Date: 2021-08-31 19:24
New changeset 2280bc116301d45efc4d69cea452d272fdcd05b1 by Miss Islington (bot) in branch '3.9':
bpo-45059: Add module cleanup to IDLE test_macosx (GH-28102)
https://github.com/python/cpython/commit/2280bc116301d45efc4d69cea452d272fdcd05b1
History
Date User Action Args
2022-04-11 14:59:49adminsetgithub: 89222
2021-08-31 19:32:19terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-08-31 19:24:53miss-islingtonsetmessages: + msg400773
2021-08-31 19:21:36miss-islingtonsetmessages: + msg400772
2021-08-31 19:01:00miss-islingtonsetpull_requests: + pull_request26548
2021-08-31 18:59:54miss-islingtonsetpull_requests: + pull_request26547
2021-08-31 18:59:41terry.reedysetmessages: + msg400771
2021-08-31 18:37:09DiddiLeijasetnosy: + DiddiLeija
2021-08-31 17:53:51miss-islingtonsetmessages: + msg400763
2021-08-31 17:50:52miss-islingtonsetmessages: + msg400762
2021-08-31 17:50:49terry.reedysetpull_requests: + pull_request26545
2021-08-31 17:41:30terry.reedysetmessages: + msg400760
2021-08-31 17:32:14miss-islingtonsetpull_requests: + pull_request26542
2021-08-31 17:32:09miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request26541
2021-08-31 17:32:09terry.reedysetmessages: + msg400758
2021-08-31 11:43:48serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request26529
2021-08-31 11:41:52serhiy.storchakacreate