Skip to content

Commit 25a2995

Browse files
FeldrinHImpaler343
authored andcommitted
Change return type of ion and ioff to fix unbound variable errors with Pyright
1 parent 5503ca9 commit 25a2995

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/pyplot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def isinteractive() -> bool:
554554
return matplotlib.is_interactive()
555555

556556

557-
def ioff() -> ExitStack:
557+
def ioff() -> AbstractContextManager:
558558
"""
559559
Disable interactive mode.
560560
@@ -584,7 +584,7 @@ def ioff() -> ExitStack:
584584
# ...
585585
586586
To enable optional usage as a context manager, this function returns a
587-
`~contextlib.ExitStack` object, which is not intended to be stored or
587+
context manager object, which is not intended to be stored or
588588
accessed by the user.
589589
"""
590590
stack = ExitStack()
@@ -594,7 +594,7 @@ def ioff() -> ExitStack:
594594
return stack
595595

596596

597-
def ion() -> ExitStack:
597+
def ion() -> AbstractContextManager:
598598
"""
599599
Enable interactive mode.
600600
@@ -624,7 +624,7 @@ def ion() -> ExitStack:
624624
# ...
625625
626626
To enable optional usage as a context manager, this function returns a
627-
`~contextlib.ExitStack` object, which is not intended to be stored or
627+
context manager object, which is not intended to be stored or
628628
accessed by the user.
629629
"""
630630
stack = ExitStack()

0 commit comments

Comments
 (0)