]> granicus.if.org Git - python/commitdiff
Fix turtle so that you can launch the demo2 function on its own instead of only
authorBrett Cannon <bcannon@gmail.com>
Mon, 16 Oct 2006 03:09:52 +0000 (03:09 +0000)
committerBrett Cannon <bcannon@gmail.com>
Mon, 16 Oct 2006 03:09:52 +0000 (03:09 +0000)
when the module is launched as a script.

Lib/lib-tk/turtle.py
Misc/NEWS

index 01a55b1522df23b89de8c31d5c738fb2caaf98e2..fcde9af4ed4e6eb92c571b9707b269997f7be069 100644 (file)
@@ -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()
index 97543b0193c3c8c48ae3eed2a5cd4cc679b33d96..e7a086ce3d01165dba74b4aac61f84d614e55fcb 100644 (file)
--- 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.