Return True if Matplotlib manages backends, False otherwise. If it returns True, the caller can be sure that matplotlib.backends.registry.backend_registry is available along with member functions resolve_gui_or_backend, resolve_backend, list_all, and list_gui_frameworks. This f
()
| 453 | |
| 454 | |
| 455 | def _matplotlib_manages_backends() -> bool: |
| 456 | """Return True if Matplotlib manages backends, False otherwise. |
| 457 | |
| 458 | If it returns True, the caller can be sure that |
| 459 | matplotlib.backends.registry.backend_registry is available along with |
| 460 | member functions resolve_gui_or_backend, resolve_backend, list_all, and |
| 461 | list_gui_frameworks. |
| 462 | |
| 463 | This function can be removed as it will always return True when Python |
| 464 | 3.12, the latest version supported by Matplotlib < 3.9, reaches |
| 465 | end-of-life in late 2028. |
| 466 | """ |
| 467 | global _matplotlib_manages_backends_value |
| 468 | if _matplotlib_manages_backends_value is None: |
| 469 | try: |
| 470 | from matplotlib.backends.registry import backend_registry |
| 471 | |
| 472 | _matplotlib_manages_backends_value = hasattr( |
| 473 | backend_registry, "resolve_gui_or_backend" |
| 474 | ) |
| 475 | except ImportError: |
| 476 | _matplotlib_manages_backends_value = False |
| 477 | |
| 478 | return _matplotlib_manages_backends_value |
| 479 | |
| 480 | |
| 481 | def _list_matplotlib_backends_and_gui_loops() -> list[str]: |
no outgoing calls
no test coverage detected
searching dependent graphs…