mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #21868: Prevent turtle crash due to invalid undo buffer size.
This commit is contained in:
parent
01963e6ae9
commit
854e76effa
2 changed files with 3 additions and 1 deletions
|
@ -2594,7 +2594,7 @@ class RawTurtle(TPen, TNavigator):
|
|||
Example (for a Turtle instance named turtle):
|
||||
>>> turtle.setundobuffer(42)
|
||||
"""
|
||||
if size is None:
|
||||
if size is None or size <= 0:
|
||||
self.undobuffer = None
|
||||
else:
|
||||
self.undobuffer = Tbuffer(size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue