Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit deae70a

Browse files
committed
win32InstalledFonts return value
1 parent 03b07fb commit deae70a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
matplotlib.font_manager.win32InstalledFonts return value
2+
````````````````````````````````````````````````````````
3+
4+
`matplotlib.font_manager.win32InstalledFonts` returns an empty list instead
5+
of None if no fonts are found.

lib/matplotlib/font_manager.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ def win32InstalledFonts(directory=None, fontext='ttf'):
181181
filenames are returned by default, or AFM fonts if *fontext* ==
182182
'afm'.
183183
"""
184-
185184
import winreg
186185

187186
if directory is None:
@@ -203,10 +202,9 @@ def win32InstalledFonts(directory=None, fontext='ttf'):
203202
path = Path(directory, direc).resolve()
204203
if path.suffix.lower() in fontext:
205204
items.add(str(path))
206-
return list(items)
207205
except (OSError, MemoryError):
208206
continue
209-
return None
207+
return list(items)
210208

211209

212210
def OSXInstalledFonts(directories=None, fontext='ttf'):

0 commit comments

Comments
 (0)