Repository: pymeasure/pymeasure

Issue:
recent changes break MKS937B check_set_errors
It was previously ok that `check_errors` returns `None` (or nothing) as for example in [MKS937B](https://github.com/pymeasure/pymeasure/blob/68f5487b0837e9f3c5debd144a7ddfeb7bddf3e5/pymeasure/instruments/mksinst/mks937b.py#L150).

Recently it got mandatory that the `check_set_errors` and `check_get_errors` return lists. This is correctly documented and some existing devices were also changed -> 1214d32.
`MKS937B` it seems was overlooked. 

https://github.com/pymeasure/pymeasure/blob/68f5487b0837e9f3c5debd144a7ddfeb7bddf3e5/pymeasure/instruments/mksinst/mks937b.py#L150-L162

Is the only change needed here to return an empty list upon no error?


Discussion:

Patch:
diff --git a/pymeasure/instruments/mksinst/mks937b.py b/pymeasure/instruments/mksinst/mks937b.py
index ab2265ab..9a752cf9 100644
--- a/pymeasure/instruments/mksinst/mks937b.py
+++ b/pymeasure/instruments/mksinst/mks937b.py
@@ -155,7 +155,8 @@ class MKS937B(Instrument):
         reply = self._re_response.search(ret)
         if reply:
             if reply.group('ack') == 'ACK':
-                return
+                self._check_extra_termination()
+                return []
         # no valid acknowledgement message found
         raise ValueError(f"invalid reply '{ret}' found in check_errors")
 


Test patch:
diff --git a/tests/instruments/mksinst/test_mks937b.py b/tests/instruments/mksinst/test_mks937b.py
index 4c9ea23a..385b625d 100644
--- a/tests/instruments/mksinst/test_mks937b.py
+++ b/tests/instruments/mksinst/test_mks937b.py
@@ -57,8 +57,18 @@ def test_ion_gauge_status_invalid_channel():
             inst.ch_2.ion_gauge_status
 
 
-def test_unit():
-    """Verify the communication of the voltage getter."""
+def test_unit_setter():
+    """Verify the communication of the unit setter."""
+    with expected_protocol(
+        MKS937B,
+        [("@253U!TORR", "@253ACKTORR"),
+         (None, b"FF")],
+    ) as inst:
+        inst.unit = "Torr"
+
+
+def test_unit_getter():
+    """Verify the communication of the unit getter."""
     with expected_protocol(
         MKS937B,
         [("@253U?", "@253ACKTORR"),
@@ -68,7 +78,7 @@ def test_unit():
 
 
 def test_power_enabled():
-    """Verify the communication of the voltage getter."""
+    """Verify the communication of the channel power getter."""
     with expected_protocol(
         MKS937B,
         [("@253CP1?", "@253ACKON"),