From 735a3c4143a32534d33001c49ee9cc52c74b24d4 Mon Sep 17 00:00:00 2001 From: Chintalagiri Shashank Date: Sun, 6 Aug 2023 02:19:46 +0530 Subject: [PATCH] Deal with bytes input. --- src/tendril/utils/types/unitbase.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tendril/utils/types/unitbase.py b/src/tendril/utils/types/unitbase.py index 755f7a0..bc71a9e 100644 --- a/src/tendril/utils/types/unitbase.py +++ b/src/tendril/utils/types/unitbase.py @@ -228,6 +228,8 @@ class NumericalUnitBase(TypedComparisonMixin, UnitBase): _separate_unit = False def __init__(self, value): + if isinstance(value, bytes): + value = value.decode() if not self._orders: doidx = self._ostrs.index(self._dostr) self._orders = [(ostr, (3 * (idx - doidx)))