summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.com>2019-07-01 22:17:25 +0200
committerDiego Elio Pettenò <flameeyes@flameeyes.com>2019-07-01 22:17:25 +0200
commitfaebae14f06afe1e31f1f9b148f575b7b6cc6fdc (patch)
tree8489ba8ec896d58826fff7eece89d57d792c63ae
parentIntroduce an explicit InvalidDateTime exception for meters with unset time. (diff)
downloadglucometerutils-faebae14f06afe1e31f1f9b148f575b7b6cc6fdc.tar
glucometerutils-faebae14f06afe1e31f1f9b148f575b7b6cc6fdc.tar.gz
glucometerutils-faebae14f06afe1e31f1f9b148f575b7b6cc6fdc.tar.bz2
glucometerutils-faebae14f06afe1e31f1f9b148f575b7b6cc6fdc.tar.lz
glucometerutils-faebae14f06afe1e31f1f9b148f575b7b6cc6fdc.tar.xz
glucometerutils-faebae14f06afe1e31f1f9b148f575b7b6cc6fdc.tar.zst
glucometerutils-faebae14f06afe1e31f1f9b148f575b7b6cc6fdc.zip
Diffstat (limited to '')
-rwxr-xr-xglucometerutils/glucometer.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/glucometerutils/glucometer.py b/glucometerutils/glucometer.py
index 14999a7..8cf2555 100755
--- a/glucometerutils/glucometer.py
+++ b/glucometerutils/glucometer.py
@@ -88,7 +88,8 @@ def main():
time_str = device.get_datetime()
except exceptions.InvalidDateTime:
time_str = 'INVALID'
- except NotImplementedError, ValueError: # Catch any leftover ValueError
+ # Also catch any leftover ValueErrors.
+ except (NotImplementedError, ValueError):
time_str = 'N/A'
print("{device_info}Time: {time}".format(
device_info=str(device_info), time=time_str))