Use logging module for these warnings

Not sure if warnings module was used intentionally here, but the
messages looked odd compared to other FontTools messages.
This commit is contained in:
Khaled Hosny 2017-05-24 10:00:55 +02:00
parent 9b2967fa39
commit 61670fc652
2 changed files with 2 additions and 4 deletions

View File

@ -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

View File

@ -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