From bd39c03c9faabcad9d6966c7e1a282e38823f456 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= <martin@v.loewis.de>
Date: Mon, 3 Jul 2006 09:44:00 +0000
Subject: Only setup canvas when it is first created. Fixes #1514703

---
 Lib/lib-tk/turtle.py | 2 +-
 Misc/NEWS            | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Lib/lib-tk/turtle.py b/Lib/lib-tk/turtle.py
index 0fe83a3..b5bad59 100644
--- a/Lib/lib-tk/turtle.py
+++ b/Lib/lib-tk/turtle.py
@@ -679,7 +679,7 @@ class Pen(RawPen):
             _canvas = Tkinter.Canvas(_root, background="white")
             _canvas.pack(expand=1, fill="both")
 
-        setup(width=_width, height= _height, startx=_startx, starty=_starty)
+            setup(width=_width, height= _height, startx=_startx, starty=_starty)
 
         RawPen.__init__(self, _canvas)
 
diff --git a/Misc/NEWS b/Misc/NEWS
index a6b4c2e..63e4b75 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -19,6 +19,9 @@ Core and builtins
 Library
 -------
 
+- Bug #1514703: Only setup canvas window in turtle when the canvas
+  is created.
+
 - Bug #1513223: .close() of a _socketobj now releases the underlying
   socket again, which then gets closed as it becomes unreferenced.
 
-- 
cgit v0.12

