Skip to content

Commit ebcf0dc

Browse files
author
brett.cannon
committed
Fix turtle so that you can launch the demo2 function on its own instead of only
when the module is launched as a script. git-svn-id: http://svn.python.org/projects/python/trunk@52354 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent f30b843 commit ebcf0dc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Lib/lib-tk/turtle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"""
1616

1717
from math import * # Also for export
18+
from time import sleep
1819
import Tkinter
1920

2021
speeds = ['fastest', 'fast', 'normal', 'slow', 'slowest']
@@ -949,7 +950,6 @@ def demo2():
949950

950951

951952
if __name__ == '__main__':
952-
from time import sleep
953953
demo()
954954
sleep(3)
955955
demo2()

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ Core and builtins
8181
Library
8282
-------
8383

84+
- Fix turtle so that time.sleep is imported for the entire library. Allows
85+
the demo2 function to be executed on its own instead of only when the
86+
module is run as a script.
87+
8488
- Bug #813342: Start the IDLE subprocess with -Qnew if the parent
8589
is started with that option.
8690

0 commit comments

Comments
 (0)