File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
src/debugpy/_vendored/pydevd/pydev_ipython Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,30 @@ def find_gui_and_backend():
5353 return gui , backend
5454
5555
56+ def _get_major_version (module ):
57+ return int (module .__version__ .split ('.' )[0 ])
58+
59+
60+ def _get_minor_version (module ):
61+ return int (module .__version__ .split ('.' )[1 ])
62+
63+
5664def is_interactive_backend (backend ):
5765 """Check if backend is interactive"""
5866 matplotlib = sys .modules ["matplotlib" ]
59- from matplotlib .rcsetup import interactive_bk , non_interactive_bk # @UnresolvedImport
67+ new_api_version = (3 , 9 )
68+ installed_version = (
69+ _get_major_version (matplotlib ),
70+ _get_minor_version (matplotlib )
71+ )
72+
73+ if installed_version >= new_api_version :
74+ interactive_bk = matplotlib .backends .backend_registry .list_builtin (
75+ matplotlib .backends .BackendFilter .INTERACTIVE )
76+ non_interactive_bk = matplotlib .backends .backend_registry .list_builtin (
77+ matplotlib .backends .BackendFilter .NON_INTERACTIVE )
78+ else :
79+ from matplotlib .rcsetup import interactive_bk , non_interactive_bk # @UnresolvedImport
6080
6181 if backend in interactive_bk :
6282 return True
You can’t perform that action at this time.
0 commit comments