From f23dfa1ae527fa3029573b8ca5e570135b6f11c3 Mon Sep 17 00:00:00 2001 From: Ken Lauer Date: Tue, 8 Aug 2023 14:09:14 -0700 Subject: [PATCH] FIX: patch over issue 565 --- .../upcoming_release_notes/565-poslimits.rst | 23 +++++++++++++++++++ typhos/positioner.py | 6 ++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 docs/source/upcoming_release_notes/565-poslimits.rst diff --git a/docs/source/upcoming_release_notes/565-poslimits.rst b/docs/source/upcoming_release_notes/565-poslimits.rst new file mode 100644 index 00000000..f48a7553 --- /dev/null +++ b/docs/source/upcoming_release_notes/565-poslimits.rst @@ -0,0 +1,23 @@ +565 poslimits +############# + +API Changes +----------- +- N/A + +Features +-------- +- N/A + +Bugfixes +-------- +- Avoid uncaught ``TypeError`` when ``None`` is present in a positioner + ``.limits``. + +Maintenance +----------- +- N/A + +Contributors +------------ +- klauer diff --git a/typhos/positioner.py b/typhos/positioner.py index 83a5b265..887075b4 100644 --- a/typhos/positioner.py +++ b/typhos/positioner.py @@ -314,7 +314,11 @@ def _link_limits_by_limits_attr(self): except Exception: ... else: - if low_limit < high_limit: + if low_limit is None or high_limit is None: + # Some devices may erroneously report `None` limits. + # TyphosPositioner will hide the limit labels in this scenario. + ... + elif low_limit < high_limit: self.ui.low_limit.setText(str(low_limit)) self.ui.high_limit.setText(str(high_limit)) return