From: Brett Cannon Date: Mon, 16 Oct 2006 03:09:52 +0000 (+0000) Subject: Fix turtle so that you can launch the demo2 function on its own instead of only X-Git-Tag: v2.6a1~2554 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d80e0c86778f92b63cf2c4d82c7248c8ece0fd47;p=python Fix turtle so that you can launch the demo2 function on its own instead of only when the module is launched as a script. --- diff --git a/Lib/lib-tk/turtle.py b/Lib/lib-tk/turtle.py index 01a55b1522..fcde9af4ed 100644 --- a/Lib/lib-tk/turtle.py +++ b/Lib/lib-tk/turtle.py @@ -15,6 +15,7 @@ pictures can easily be drawn. """ from math import * # Also for export +from time import sleep import Tkinter speeds = ['fastest', 'fast', 'normal', 'slow', 'slowest'] @@ -949,7 +950,6 @@ def demo2(): if __name__ == '__main__': - from time import sleep demo() sleep(3) demo2() diff --git a/Misc/NEWS b/Misc/NEWS index 97543b0193..e7a086ce3d 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -81,6 +81,10 @@ Core and builtins Library ------- +- Fix turtle so that time.sleep is imported for the entire library. Allows + the demo2 function to be executed on its own instead of only when the + module is run as a script. + - Bug #813342: Start the IDLE subprocess with -Qnew if the parent is started with that option.