Skip to content

Commit a67466a

Browse files
committed
chatty_client: check for error when setting port rename callback
This is not available in JACK1, where it causes an exception.
1 parent 8fb0d23 commit a67466a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

examples/chatty_client.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,13 @@ def port_connect(a, b, connect):
7777
print(["disconnected", "connected"][connect], a, "and", b)
7878

7979

80-
@client.set_port_rename_callback
81-
def port_rename(port, old, new):
82-
print("renamed", port, "from", repr(old), "to", repr(new))
83-
return jack.SUCCESS
80+
try:
81+
@client.set_port_rename_callback
82+
def port_rename(port, old, new):
83+
print("renamed", port, "from", repr(old), "to", repr(new))
84+
return jack.SUCCESS
85+
except:
86+
print("Could not register port rename callback (not available on JACK1).")
8487

8588

8689
@client.set_graph_order_callback

0 commit comments

Comments
 (0)