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

Skip to content

Commit af90581

Browse files
committed
[ 1841933 ] font_manager.win32FontDirectory() fails as Vista service
svn path=/trunk/matplotlib/; revision=4653
1 parent b751318 commit af90581

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/matplotlib/font_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,16 @@ def win32FontDirectory():
105105
try:
106106
import _winreg
107107
except ImportError:
108-
return os.path.join(os.environ['WINDIR'], 'Fonts')
108+
pass # Fall through to default
109109
else:
110110
user = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, MSFolders)
111111
try:
112112
return _winreg.QueryValueEx(user, 'Fonts')[0]
113+
except OSError:
114+
pass # Fall through to default
113115
finally:
114116
_winreg.CloseKey(user)
115-
return None
117+
return os.path.join(os.environ['WINDIR'], 'Fonts')
116118

117119
def win32InstalledFonts(directory=None, fontext='ttf'):
118120
"""

0 commit comments

Comments
 (0)