8000 Exception type modified according to @pelson comment · matplotlib/matplotlib@b297f41 · GitHub
[go: up one dir, main page]

Skip to content

Commit b297f41

Browse files
committed
Exception type modified according to @pelson comment
1 parent 873e91d commit b297f41

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/matplotlib/figure.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@
5050

5151
docstring.interpd.update(projection_names=get_projection_names())
5252

53-
class AxesException(Exception):
54-
pass
55-
5653
class AxesStack(Stack):
5754
"""
5855
Specialization of the Stack to handle all tracking of Axes in a Figure.
@@ -876,7 +873,7 @@ def add_axes(self, *args, **kwargs):
876873
a = args[0]
877874
if a.get_figure() is not self:
878875
msg = "The Axes must have been created in the present figure"
879-
raise AxesException(msg)
876+
raise ValueError(msg)
880877
else:
881878
rect = args[0]
882879
projection_class, kwargs, key = process_projection_requirements(
@@ -952,7 +949,7 @@ def add_subplot(self, *args, **kwargs):
952949
a = args[0]
953950
if a.get_figure() is not self:
954951
msg = "The Subplot must have been created in the present figure"
955-
raise AxesException(msg)
952+
raise ValueError(msg)
956953
# make a key for the subplot (which includes the axes object id
957954
# in the hash)
958955
key = self._make_key(*args, **kwargs)

0 commit comments

Comments
 (0)
0