use logging.warning() instead of deprecated logging.warn()

functionality is identical, the latter is deprecated:
https://docs.python.org/3/library/logging.html#logging.Logger.warning
This commit is contained in:
Cosimo Lupo 2017-05-24 09:49:37 +01:00
parent a3d199e06c
commit a4861a16cc
No known key found for this signature in database
GPG Key ID: B61AAAD0B53A6419
3 changed files with 3 additions and 3 deletions

View File

@ -388,7 +388,7 @@ def merge(self, m, tables):
# char previously mapped to oldgid but already remapped to a different gid, # char previously mapped to oldgid but already remapped to a different gid,
# save new gid as an alternate # save new gid as an alternate
# TODO: try harder to save these # TODO: try harder to save these
log.warn("Dropped mapping from codepoint %#06X to glyphId '%s'", uni, gid) log.warning("Dropped mapping from codepoint %#06X to glyphId '%s'", uni, gid)
cmapBmpOnly = {uni: gid for uni,gid in cmap.items() if uni <= 0xFFFF} cmapBmpOnly = {uni: gid for uni,gid in cmap.items() if uni <= 0xFFFF}
self.tables = [] self.tables = []

View File

@ -1073,7 +1073,7 @@ class Tokenizer(object):
if len(line) == 1 and not line[0]: if len(line) == 1 and not line[0]:
del line[0] del line[0]
if line and not line[-1]: if line and not line[-1]:
log.warn('trailing tab found on line %d: %s' % (self.lineno, self.line)) log.warning('trailing tab found on line %d: %s' % (self.lineno, self.line))
while line and not line[-1]: while line and not line[-1]:
del line[-1] del line[-1]
return line return line

View File

@ -218,7 +218,7 @@ def _add_gvar(font, model, master_ttfs, tolerance=.5):
allControls = [d[1] for d in allData] allControls = [d[1] for d in allData]
control = allControls[0] control = allControls[0]
if (any(c != control for c in allControls)): if (any(c != control for c in allControls)):
log.warn("glyph %s has incompatible masters; skipping" % glyph) log.warning("glyph %s has incompatible masters; skipping" % glyph)
continue continue
del allControls del allControls