Skip to content

Commit

Permalink
FIX: Handle NonSupportedFeature exception for pipes (#660)
Browse files Browse the repository at this point in the history
* Old tango servers don't support the pipe API when used with PyTango versions less than 9. Since we don't support pipes yet anyway, we should handle this exception and move on.

* Fixed linting. NonSupportedFeature is not a recognizable import symbol because of something in pytango so type checking needs to ignore it.

* Trigger CI/CD pipeline
  • Loading branch information
burkeds authored and evalott100 committed Nov 27, 2024
1 parent 622b8ba commit 137006c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/ophyd_async/tango/signal/_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
SignalW,
SignalX,
)
from tango import AttrDataFormat, AttrWriteType, CmdArgType, DeviceProxy, DevState
from tango import (
AttrDataFormat,
AttrWriteType,
CmdArgType,
DeviceProxy,
DevState,
NonSupportedFeature, # type: ignore
)
from tango.asyncio import DeviceProxy as AsyncDeviceProxy

from ._tango_transport import TangoSignalBackend, get_python_type
Expand Down Expand Up @@ -174,8 +181,11 @@ async def infer_signal_type(
else:
dev_proxy = proxy

if tr_name in dev_proxy.get_pipe_list():
raise NotImplementedError("Pipes are not supported")
try:
if tr_name in dev_proxy.get_pipe_list():
raise NotImplementedError("Pipes are not supported")
except NonSupportedFeature: # type: ignore
pass

if tr_name not in dev_proxy.get_attribute_list():
if tr_name not in dev_proxy.get_command_list():
Expand Down

0 comments on commit 137006c

Please sign in to comment.