From 7800d521704de17f3a0a60dc4d5cf262b8cdd5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sat, 3 Aug 2013 09:55:58 +0100 Subject: otultra2: fix default unit handling. --- glucometerutils/drivers/otultra2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glucometerutils/drivers/otultra2.py b/glucometerutils/drivers/otultra2.py index 43be6d4..3182b42 100644 --- a/glucometerutils/drivers/otultra2.py +++ b/glucometerutils/drivers/otultra2.py @@ -235,7 +235,8 @@ class Device(object): if not match: raise exceptions.InvalidResponse(header) - final_unit = unit or self._ParseGlucoseUnit(match.group(2)) + if not unit: + unit = self._ParseGlucoseUnit(match.group(2)) count = int(match.group(1)) assert count == len(data) -- cgit v1.2.3