File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -529,23 +529,25 @@ def createFontList(fontfiles, fontext='ttf'):
529
529
continue
530
530
try :
531
531
prop = afmFontProperty (fpath , font )
532
- except KeyError :
532
+ except KeyError as exc :
533
+ _log .info ("Could not extract properties for %s: %s" ,
534
+ fpath , exc )
533
535
continue
534
536
else :
535
537
try :
536
538
font = ft2font .FT2Font (fpath )
537
- except RuntimeError :
538
- _log .info ("Could not open font file %s" , fpath )
539
+ except ( OSError , RuntimeError ) as exc :
540
+ _log .info ("Could not open font file %s: %s " , fpath , exc )
539
541
continue
540
542
except UnicodeError :
541
543
_log .info ("Cannot handle unicode filenames" )
542
544
continue
543
- except OSError :
544
- _log .info ("IO error - cannot open font file %s" , fpath )
545
- continue
546
545
try :
547
546
prop = ttfFontProperty (font )
548
- except (KeyError , RuntimeError , ValueError , NotImplementedError ):
547
+ except (KeyError , RuntimeError , ValueError ,
548
+ NotImplementedError ) as exc :
549
+ _log .info ("Could not extract properties for %s: %s" ,
550
+ fpath , exc )
549
551
continue
550
552
551
553
fontlist .append (prop )
You can’t perform that action at this time.
0 commit comments