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: turtledemo: clean up start and stop, fix warning
Type: behavior Stage: resolved
Components: Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: python-dev, terry.reedy
Priority: normal Keywords: patch

Created on 2014-07-23 21:24 by terry.reedy, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
turdemo_start_stop.diff terry.reedy, 2014-07-23 21:24 review
Messages (6)
msg223780 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-07-23 21:24
The patch adds a main function with the minimum needed to start the mainloop. It omits the 'while RUN' loop and development code for catching exceptions while running. They should never happen, and silently suppressing tracebacks is a bad idea.

The patch also deletes the unneeded sys.exit() call from _destroy. In 3.x debug builds, this call results in the following clipped warning being printed in the startup console.

    while executing
"46111032_destroy"
    (command for "WM_DELETE_WINDOW" window manager protocol) 

These no longer occur when sys.exit() is removed.

Turtledemo works fine with these changes.
msg223781 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-07-23 21:28
New changeset 823f5507bd86 by Terry Jan Reedy in branch '2.7':
Issue #22053: Cleanup turtledemo start and stop and fix debug shutdown warning.
http://hg.python.org/cpython/rev/823f5507bd86

New changeset 57531d65cdd4 by Terry Jan Reedy in branch '3.4':
Issue #22053: Cleanup turtledemo start and stop and fix debug shutdown warning.
http://hg.python.org/cpython/rev/57531d65cdd4
msg223920 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-07-25 06:27
New changeset 7a55b34f1db2 by Terry Jan Reedy in branch '2.7':
Issue #22053: Make help work, after previous patch for this issue disabled it
http://hg.python.org/cpython/rev/7a55b34f1db2

New changeset c26862955342 by Terry Jan Reedy in branch '3.4':
Issue #22053: Make help work, after previous patch for this issue disabled it
http://hg.python.org/cpython/rev/c26862955342

New changeset 8c972d528f06 by Terry Jan Reedy in branch 'default':
Issue #22053: Make help work, after previous patch for this issue disabled it
http://hg.python.org/cpython/rev/8c972d528f06
msg223921 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-07-25 06:43
Removal of 'demo' as a global name disabled help callbacks. I could have added 'global demo' to main(), but I decided to refactor and remove duplicate code instead. For 3.5, however, refactor would not merge because of #10291, so I made the simplest fix pending a decision on what to do.
msg225334 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-08-15 04:51
After backporting 004fe3449193 (#10921 3.5 patch) with changes as 7708f80940b0, forward port to 3.5 the 3.4 patch c26862955342 that did not merge before.  The 3.4 and 3.5 files are identical.

Misdirected changeset notices:

New changeset 4349bbc21ca7 by Terry Jan Reedy in branch 'default':
Issue #22065: forward port the changes in c26862955342, update docstring with
http://hg.python.org/cpython/rev/4349bbc21ca7

New changeset 59cc3bfdac4b by Terry Jan Reedy in branch 'default':
Issue #22065: Try the delete demohelp.txt part again.
http://hg.python.org/cpython/rev/59cc3bfdac4b
msg225336 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-15 04:57
New changeset 5aa3f4863dda by Terry Jan Reedy in branch '3.4':
#22053: actually remove .txt files from 3.4.
http://hg.python.org/cpython/rev/5aa3f4863dda
History
Date User Action Args
2022-04-11 14:58:06adminsetgithub: 66252
2014-08-15 04:57:26python-devsetmessages: + msg225336
2014-08-15 04:51:33terry.reedysetmessages: + msg225334
2014-07-25 06:43:00terry.reedysetmessages: + msg223921
2014-07-25 06:27:08python-devsetmessages: + msg223920
2014-07-23 21:29:21terry.reedysetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2014-07-23 21:28:39python-devsetnosy: + python-dev
messages: + msg223781
2014-07-23 21:24:33terry.reedycreate