diff --git a/piker/brokers/ib/api.py b/piker/brokers/ib/api.py index 7565e1ca..2ee7b238 100644 --- a/piker/brokers/ib/api.py +++ b/piker/brokers/ib/api.py @@ -1831,7 +1831,7 @@ class MethodProxy: ev = self.event_table.get(pattern) - if not ev or ev.is_set(): + if ev is None or ev.is_set(): # print(f'inserting new data reset event item') ev = self.event_table[pattern] = trio.Event() @@ -1953,7 +1953,7 @@ async def relay_client_proxy_messages( reason = status_msg['reason'] event = proxy.event_table.pop(reason, None) if ( - event + event is not None and event.statistics().tasks_waiting ): diff --git a/piker/data/_web_bs.py b/piker/data/_web_bs.py index 60c12639..f083e300 100644 --- a/piker/data/_web_bs.py +++ b/piker/data/_web_bs.py @@ -323,7 +323,7 @@ async def _reconnect_forever( # if wrapper cancelled us, we expect it to also # have re-assigned a new event assert ( - nobsws._connected + nobsws._connected is not None and not nobsws._connected.is_set() ) diff --git a/piker/ui/_display.py b/piker/ui/_display.py index 06afd142..656331df 100644 --- a/piker/ui/_display.py +++ b/piker/ui/_display.py @@ -569,7 +569,7 @@ async def graphics_update_loop( continue ic = fast_chart.view._in_interact - if ic: + if ic is not None: fast_chart.pause_all_feeds() log.debug( f'Pausing chart updaates during interaction\n' diff --git a/piker/ui/_interaction.py b/piker/ui/_interaction.py index 9e4ce0e4..7ba813db 100644 --- a/piker/ui/_interaction.py +++ b/piker/ui/_interaction.py @@ -639,7 +639,7 @@ class ChartView(ViewBox): self.order_mode: bool = False self.setFocusPolicy(QtCore.Qt.StrongFocus) - self._in_interact: trio.Event | None = None + self._in_interact: trio.Event|None = None self._interact_stack: ExitStack = ExitStack() # TODO: probably just assign this whenever a new `PlotItem` is @@ -677,7 +677,7 @@ class ChartView(ViewBox): to any waiters. ''' - if self._in_interact: + if self._in_interact is not None: try: self._interact_stack.close() self.chart.resume_all_feeds() @@ -1212,7 +1212,7 @@ class ChartView(ViewBox): str, tuple[float, float], ] | None = None, - + ): profiler = Profiler( msg=f'ChartView.interact_graphics_cycle() for {self.name}',