Skip to content

Commit

Permalink
Check for tuple instead of just oldName
Browse files Browse the repository at this point in the history
  • Loading branch information
yanone committed Sep 26, 2023
1 parent 748ed47 commit 81d528f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Lib/fontmake/instantiator.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,17 @@ def process_rules_swaps(rules, location, glyphNames):
# I guess it should be, so that we can swap, and if it isn't,
# then it's better to error out later when we try to swap,
# instead of silently ignoring the rule here.
# Also checking for duplication of rules by oldName here:
oldName_exists = oldName in [swap[0] for swap in swaps]
if oldName_exists:
# Also checking for duplication of rules here:
pair = (oldName, newName)
swap_exists = pair in swaps
if swap_exists:
logging.warning(
"Duplicate rule for %s in location %s: %s",
(oldName, newName),
location,
swaps[[swap[0] for swap in swaps].index(oldName)]
"Duplicate rule for %s in location %s",
pair,
location
)
if oldName in glyphNames and not oldName_exists:
swaps.append((oldName, newName))
if oldName in glyphNames and not swap_exists:
swaps.append(pair)
return swaps


Expand Down

0 comments on commit 81d528f

Please sign in to comment.