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.

Author Lita.Cho
Recipients Lita.Cho, asvetlov, belopolsky, gregorlingl, jesstess, ned.deily, srid
Date 2014-05-23.23:32:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1400887927.25.0.477741309865.issue6639@psf.upfronthosting.co.za>
In-reply-to
Content
I was looking at this more, and from my understanding, the turtle code is continuing to run even when the TK window is destroyed. Thus the crash.

It looks like the drawing functions are being made on the fly with the following method:

for methodname in _tg_turtle_functions:
    pl1, pl2 = getmethparlist(eval('Turtle.' + methodname))
    if pl1 == "":
        print(">>>>>>", pl1, pl2)
        continue
    defstr = ("def %(key)s%(pl1)s: return _getpen().%(key)s%(pl2)s" %
                                   {'key':methodname, 'pl1':pl1, 'pl2':pl2})
    exec(defstr)
    eval(methodname).__doc__ = _turtle_docrevise(eval('Turtle.'+methodname).__doc__)

So while all the methods are being generated, I am going to add in a check to see if the window was destroyed before running the pen code. If it was, then I exit gratefully. The check will be duplicated for each pen method, but I feel it is the best way to contain the check within the turtle.py module. The other option would be to make the user check for it, which is not a good option.
History
Date User Action Args
2014-05-23 23:32:07Lita.Chosetrecipients: + Lita.Cho, belopolsky, gregorlingl, ned.deily, asvetlov, srid, jesstess
2014-05-23 23:32:07Lita.Chosetmessageid: <1400887927.25.0.477741309865.issue6639@psf.upfronthosting.co.za>
2014-05-23 23:32:07Lita.Cholinkissue6639 messages
2014-05-23 23:32:06Lita.Chocreate