Issue #21868: Prevent turtle crash due to invalid undo buffer size.

This commit is contained in:
Raymond Hettinger 2014-07-20 21:30:32 -07:00
parent 01963e6ae9
commit 854e76effa
2 changed files with 3 additions and 1 deletions

View file

@ -2594,7 +2594,7 @@ class RawTurtle(TPen, TNavigator):
Example (for a Turtle instance named turtle): Example (for a Turtle instance named turtle):
>>> turtle.setundobuffer(42) >>> turtle.setundobuffer(42)
""" """
if size is None: if size is None or size <= 0:
self.undobuffer = None self.undobuffer = None
else: else:
self.undobuffer = Tbuffer(size) self.undobuffer = Tbuffer(size)

View file

@ -30,6 +30,8 @@ Library
- Issue #21044: tarfile.open() now handles fileobj with an integer 'name' - Issue #21044: tarfile.open() now handles fileobj with an integer 'name'
attribute. Based on patch by Martin Panter. attribute. Based on patch by Martin Panter.
- Issue #21867: Prevent turtle crash due to invalid undo buffer size.
- Issue #19076: Don't pass the redundant 'file' argument to self.error(). - Issue #19076: Don't pass the redundant 'file' argument to self.error().
- Issue #21942: Fixed source file viewing in pydoc's server mode on Windows. - Issue #21942: Fixed source file viewing in pydoc's server mode on Windows.