From 85e748df4fd278437a878a1df614111f44393d88 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 23 Jul 2015 16:57:28 +0200 Subject: [PATCH] configtypes: Add else-branch to QtFont. --- qutebrowser/config/configtypes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index aac22c8da..9d5b887e7 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -744,6 +744,11 @@ class QtFont(Font): font.setPointSizeF(float(size[:-2])) elif size.lower().endswith('px'): font.setPixelSize(int(size[:-2])) + else: + # This should never happen as the regex only lets pt/px + # through. + raise ValueError("Unexpected size unit in {!r}!".format( + size)) # pragma: no cover # The Qt CSS parser handles " and ' before passing the string to # QFont.setFamily. We could do proper CSS-like parsing here, but since # hopefully nobody will ever have a font with quotes in the family (if