changeset: 92415:fac17d06e01d branch: 3.4 parent: 92413:429acfbef89c user: Ned Deily date: Sat Sep 13 23:39:16 2014 -0700 files: Lib/turtle.py Misc/NEWS description: Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X. diff -r 429acfbef89c -r fac17d06e01d Lib/turtle.py --- a/Lib/turtle.py Sat Sep 13 01:44:34 2014 -0400 +++ b/Lib/turtle.py Sat Sep 13 23:39:16 2014 -0700 @@ -997,8 +997,9 @@ # Force Turtle window to the front on OS X. This is needed because # the Turtle window will show behind the Terminal window when you # start the demo from the command line. - cv._rootwindow.call('wm', 'attributes', '.', '-topmost', '1') - cv._rootwindow.call('wm', 'attributes', '.', '-topmost', '0') + rootwindow = cv.winfo_toplevel() + rootwindow.call('wm', 'attributes', '.', '-topmost', '1') + rootwindow.call('wm', 'attributes', '.', '-topmost', '0') def clear(self): """Delete all drawings and all turtles from the TurtleScreen. diff -r 429acfbef89c -r fac17d06e01d Misc/NEWS --- a/Misc/NEWS Sat Sep 13 01:44:34 2014 -0400 +++ b/Misc/NEWS Sat Sep 13 23:39:16 2014 -0700 @@ -32,6 +32,8 @@ Library ------- +- Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X. + - Issue #21147: sqlite3 now raises an exception if the request contains a null character instead of truncate it. Based on patch by Victor Stinner.