We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 99f4a91 + 24f2970 commit 286e53bCopy full SHA for 286e53b
lib/matplotlib/font_manager.py
@@ -266,8 +266,11 @@ def _get_fontconfig_fonts():
266
@lru_cache
267
def _get_macos_fonts():
268
"""Cache and list the font paths known to ``system_profiler SPFontsDataType``."""
269
- d, = plistlib.loads(
270
- subprocess.check_output(["system_profiler", "-xml", "SPFontsDataType"]))
+ try:
+ d, = plistlib.loads(
271
+ subprocess.check_output(["system_profiler", "-xml", "SPFontsDataType"]))
272
+ except (OSError, subprocess.CalledProcessError, plistlib.InvalidFileException):
273
+ return []
274
return [Path(entry["path"]) for entry in d["_items"]]
275
276
0 commit comments