Skip to content

Commit

Permalink
font-patcher: Comment on maybe strange looking code
Browse files Browse the repository at this point in the history
[why]
I again had to look the reason for the code up, which just looks
strange. Who expects that a bool is an instance of int? I certainly not.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
  • Loading branch information
Finii committed Jan 8, 2025
1 parent 60e7e5e commit 171ac54
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -2168,6 +2168,7 @@ def setup_arguments():
logger.critical("Can not create single font files from True Type Collections")
sys.exit(1)

# The if might look ridiculous, but isinstance(False, int) is True!
if isinstance(args.xavgwidth, int) and not isinstance(args.xavgwidth, bool):
if args.xavgwidth < 0:
logger.critical("--xavgcharwidth takes no negative numbers")
Expand Down

0 comments on commit 171ac54

Please sign in to comment.