From 87e2e2c98f79d60e5c6fce85ae14acd1ef525f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Seppa=CC=88nen?= Date: Mon, 16 Jan 2012 23:37:38 +0200 Subject: [PATCH] Only call dirname on string-like directory names --- lib/matplotlib/font_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/font_manager.py b/lib/matplotlib/font_manager.py index b0c7c07971b0..e8817c82a7f0 100644 --- a/lib/matplotlib/font_manager.py +++ b/lib/matplotlib/font_manager.py @@ -223,6 +223,8 @@ def win32InstalledFonts(directory=None, fontext='ttf'): for j in range(_winreg.QueryInfoKey(local)[1]): try: key, direc, any = _winreg.EnumValue( local, j) + if not is_string_like(direc): + continue if not os.path.dirname(direc): direc = os.path.join(directory, direc) direc = os.path.abspath(direc).lower()