Skip to content

Commit e39b7f2

Browse files
gh-136722: Document the turtle.TurtleGraphicsError exception (#157792)
Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 5b34363 commit e39b7f2

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎Doc/library/turtle.rst‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,6 +2571,25 @@ Public classes
25712571
* ``a.rotate(angle)`` rotation
25722572

25732573

2574+
Exceptions
2575+
==========
2576+
2577+
The :mod:`!turtle` module defines the following exception:
2578+
2579+
.. exception:: TurtleGraphicsError
2580+
2581+
Raised for invalid arguments or operations.
2582+
For example, a malformed color string:
2583+
2584+
.. doctest::
2585+
:skipif: _tkinter is None
2586+
2587+
>>> turtle.color("blau")
2588+
Traceback (most recent call last):
2589+
...
2590+
turtle.TurtleGraphicsError: bad color string: blau
2591+
2592+
25742593
.. _turtle-explanation:
25752594

25762595
Explanation

0 commit comments

Comments
 (0)