Closed PH111P closed 5 years ago
In the current version available on Arch Linux (r276.1565263100.8ba5c61), the following code raises an exception, which, to my understanding, should not happen:
r276.1565263100.8ba5c61
import i3ipc conn = i3ipc.Connection(auto_reconnect=True) conn.on('workspace', lambda conn, evt: print('Hello'))
TypeError Traceback (most recent call last) <ipython-input-5-e048a753152d> in <module> ----> 1 conn.on('workspace', lambda conn, evt: print('')) /usr/lib/python3.7/site-packages/i3ipc/connection.py in on(self, detailed_event, handler) 415 raise Exception('event not implemented') 416 --> 417 self.subscriptions |= event_type.value 418 419 self._pubsub.subscribe(detailed_event, handler) TypeError: unsupported operand type(s) for |=: 'Event' and 'int'
Interestingly, this error is not raised if the connection object is created without setting auto_reconnect.
auto_reconnect
As far as I understand, line 417 should be changed to self.subscriptions |= event_type.
self.subscriptions |= event_type
:+1:
In the current version available on Arch Linux (
r276.1565263100.8ba5c61
), the following code raises an exception, which, to my understanding, should not happen:Interestingly, this error is not raised if the connection object is created without setting
auto_reconnect
.As far as I understand, line 417 should be changed to
self.subscriptions |= event_type
.