Merge pull request #974 from khaledhosny/warnings
Use logging module for a couple of warnings
This commit is contained in:
commit
a3d199e06c
@ -17,7 +17,6 @@ from fontTools.otlLib import builder as otl
|
||||
from contextlib import contextmanager
|
||||
from operator import setitem
|
||||
import logging
|
||||
import warnings
|
||||
|
||||
class MtiLibError(Exception): pass
|
||||
class ReferenceNotFoundError(MtiLibError): pass
|
||||
@ -1074,7 +1073,7 @@ class Tokenizer(object):
|
||||
if len(line) == 1 and not line[0]:
|
||||
del line[0]
|
||||
if line and not line[-1]:
|
||||
warnings.warn('trailing tab found on line %d: %s' % (self.lineno, self.line))
|
||||
log.warn('trailing tab found on line %d: %s' % (self.lineno, self.line))
|
||||
while line and not line[-1]:
|
||||
del line[-1]
|
||||
return line
|
||||
|
@ -30,7 +30,6 @@ from fontTools.ttLib.tables import otTables as ot
|
||||
from fontTools.varLib import builder, designspace, models
|
||||
from fontTools.varLib.merger import VariationMerger, _all_equal
|
||||
from collections import OrderedDict
|
||||
import warnings
|
||||
import os.path
|
||||
import logging
|
||||
from pprint import pformat
|
||||
@ -219,7 +218,7 @@ def _add_gvar(font, model, master_ttfs, tolerance=.5):
|
||||
allControls = [d[1] for d in allData]
|
||||
control = allControls[0]
|
||||
if (any(c != control for c in allControls)):
|
||||
warnings.warn("glyph %s has incompatible masters; skipping" % glyph)
|
||||
log.warn("glyph %s has incompatible masters; skipping" % glyph)
|
||||
continue
|
||||
del allControls
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user