Skip to content

Commit 4a4f679

Browse files
committed
fixed setshape method
1 parent 22637d6 commit 4a4f679

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Lib/turtle.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,6 +2705,7 @@ def __init__(self, screen, shapeIndex):
27052705

27062706
def _setshape(self, shapeIndex):
27072707
screen = self.screen
2708+
self.shapeIndex = shapeIndex
27082709
if self._type == "polygon" == screen._shapes[shapeIndex]._type:
27092710
return
27102711
if self._type == "image" == screen._shapes[shapeIndex]._type:
@@ -2715,11 +2716,8 @@ def _setshape(self, shapeIndex):
27152716
for item in self._item:
27162717
screen._delete(item)
27172718
elif self._type == "transformable_image":
2718-
del self._item
2719-
2719+
self._item.delete()
27202720
self._type = screen._shapes[shapeIndex]._type
2721-
self.shapeIndex = shapeIndex
2722-
27232721
if self._type == "polygon":
27242722
self._item = screen._createpoly()
27252723
elif self._type == "image":

0 commit comments

Comments
 (0)