File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -226,15 +226,17 @@ def win32InstalledFonts(directory=None, fontext='ttf'):
226
226
local = winreg .OpenKey (winreg .HKEY_LOCAL_MACHINE , fontdir )
227
227
except OSError :
228
228
continue
229
-
230
229
if not local :
231
230
return list_fonts (directory , fontext )
232
231
try :
233
232
for j in range (winreg .QueryInfoKey (local )[1 ]):
234
233
try :
235
- key , direc , any = winreg .EnumValue ( local , j )
234
+ key , direc , tp = winreg .EnumValue (local , j )
236
235
if not isinstance (direc , six .string_types ):
237
236
continue
237
+ # Work around for https://bugs.python.org/issue25778, which
238
+ # is fixed in Py>=3.6.1.
239
+ direc = direc .split ("\0 " , 1 )[0 ]
238
240
if not os .path .dirname (direc ):
239
241
direc = os .path .join (directory , direc )
240
242
direc = os .path .abspath (direc ).lower ()
You can’t perform that action at this time.
0 commit comments