Skip to content

Commit 31f9070

Browse files
miss-islingtonshanyuduoStanFromIreland
authored
[3.14] gh-136722: Document the turtle.TurtleGraphicsError exception (GH-157792) (#157795)
(cherry picked from commit e39b7f2) Co-authored-by: 单禹铎 <mmg114514@outlook.com> Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent d3369c2 commit 31f9070

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
@@ -2570,6 +2570,25 @@ Public classes
25702570
* ``a.rotate(angle)`` rotation
25712571

25722572

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

25752594
Explanation

0 commit comments

Comments
 (0)