Skip to content

Commit

Permalink
Deal with bytes input.
Browse files Browse the repository at this point in the history
  • Loading branch information
chintal committed Aug 5, 2023
1 parent a8dff51 commit 735a3c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tendril/utils/types/unitbase.py
Expand Up @@ -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)))
Expand Down

0 comments on commit 735a3c4

Please sign in to comment.